kgolawski 3 months ago committed by GitHub
commit 95b1958b3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -43,6 +46,9 @@ typedef struct vc
#include M2S(INCLUDE_PATH/inc_veracrypt_keyfile.cl) #include M2S(INCLUDE_PATH/inc_veracrypt_keyfile.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc_tmp typedef struct vc_tmp
{ {
u32 ipad[16]; u32 ipad[16];
@ -208,7 +214,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[3] = ripemd160_hmac_ctx.opad.h[3];
tmps[gid].opad[4] = ripemd160_hmac_ctx.opad.h[4]; tmps[gid].opad[4] = ripemd160_hmac_ctx.opad.h[4];
ripemd160_hmac_update_global (&ripemd160_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); ripemd160_hmac_update_global (&ripemd160_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 16; i += 5, j += 1) for (u32 i = 0, j = 1; i < 16; i += 5, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -259,7 +262,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[3] = ripemd160_hmac_ctx.opad.h[3];
tmps[gid].opad[4] = ripemd160_hmac_ctx.opad.h[4]; tmps[gid].opad[4] = ripemd160_hmac_ctx.opad.h[4];
ripemd160_hmac_update_global (&ripemd160_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); ripemd160_hmac_update_global (&ripemd160_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 32; i += 5, j += 1) for (u32 i = 0, j = 1; i < 32; i += 5, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -324,7 +327,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[3] = ripemd160_hmac_ctx.opad.h[3];
tmps[gid].opad[4] = ripemd160_hmac_ctx.opad.h[4]; tmps[gid].opad[4] = ripemd160_hmac_ctx.opad.h[4];
ripemd160_hmac_update_global (&ripemd160_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); ripemd160_hmac_update_global (&ripemd160_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 48; i += 5, j += 1) for (u32 i = 0, j = 1; i < 48; i += 5, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -236,7 +239,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[6] = sha512_hmac_ctx.opad.h[6];
tmps[gid].opad[7] = sha512_hmac_ctx.opad.h[7]; tmps[gid].opad[7] = sha512_hmac_ctx.opad.h[7];
sha512_hmac_update_global_swap (&sha512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); sha512_hmac_update_global_swap (&sha512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 8; i += 8, j += 1) for (u32 i = 0, j = 1; i < 8; i += 8, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -287,7 +290,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[6] = sha512_hmac_ctx.opad.h[6];
tmps[gid].opad[7] = sha512_hmac_ctx.opad.h[7]; tmps[gid].opad[7] = sha512_hmac_ctx.opad.h[7];
sha512_hmac_update_global_swap (&sha512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); sha512_hmac_update_global_swap (&sha512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 16; i += 8, j += 1) for (u32 i = 0, j = 1; i < 16; i += 8, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -352,7 +355,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[6] = sha512_hmac_ctx.opad.h[6];
tmps[gid].opad[7] = sha512_hmac_ctx.opad.h[7]; tmps[gid].opad[7] = sha512_hmac_ctx.opad.h[7];
sha512_hmac_update_global_swap (&sha512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); sha512_hmac_update_global_swap (&sha512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 24; i += 8, j += 1) for (u32 i = 0, j = 1; i < 24; i += 8, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -332,7 +335,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[14] = whirlpool_hmac_ctx.opad.h[14];
tmps[gid].opad[15] = whirlpool_hmac_ctx.opad.h[15]; tmps[gid].opad[15] = whirlpool_hmac_ctx.opad.h[15];
whirlpool_hmac_update_global_swap (&whirlpool_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); whirlpool_hmac_update_global_swap (&whirlpool_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 16; i += 16, j += 1) for (u32 i = 0, j = 1; i < 16; i += 16, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -383,7 +386,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[14] = whirlpool_hmac_ctx.opad.h[14];
tmps[gid].opad[15] = whirlpool_hmac_ctx.opad.h[15]; tmps[gid].opad[15] = whirlpool_hmac_ctx.opad.h[15];
whirlpool_hmac_update_global_swap (&whirlpool_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); whirlpool_hmac_update_global_swap (&whirlpool_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 32; i += 16, j += 1) for (u32 i = 0, j = 1; i < 32; i += 16, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -448,7 +451,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[14] = whirlpool_hmac_ctx.opad.h[14];
tmps[gid].opad[15] = whirlpool_hmac_ctx.opad.h[15]; tmps[gid].opad[15] = whirlpool_hmac_ctx.opad.h[15];
whirlpool_hmac_update_global_swap (&whirlpool_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); whirlpool_hmac_update_global_swap (&whirlpool_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 48; i += 16, j += 1) for (u32 i = 0, j = 1; i < 48; i += 16, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -220,7 +223,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[6] = sha256_hmac_ctx.opad.h[6];
tmps[gid].opad[7] = sha256_hmac_ctx.opad.h[7]; tmps[gid].opad[7] = sha256_hmac_ctx.opad.h[7];
sha256_hmac_update_global_swap (&sha256_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); sha256_hmac_update_global_swap (&sha256_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 16; i += 8, j += 1) for (u32 i = 0, j = 1; i < 16; i += 8, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -271,7 +274,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[6] = sha256_hmac_ctx.opad.h[6];
tmps[gid].opad[7] = sha256_hmac_ctx.opad.h[7]; tmps[gid].opad[7] = sha256_hmac_ctx.opad.h[7];
sha256_hmac_update_global_swap (&sha256_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); sha256_hmac_update_global_swap (&sha256_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 32; i += 8, j += 1) for (u32 i = 0, j = 1; i < 32; i += 8, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -336,7 +339,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[6] = sha256_hmac_ctx.opad.h[6];
tmps[gid].opad[7] = sha256_hmac_ctx.opad.h[7]; tmps[gid].opad[7] = sha256_hmac_ctx.opad.h[7];
sha256_hmac_update_global_swap (&sha256_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); sha256_hmac_update_global_swap (&sha256_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 48; i += 8, j += 1) for (u32 i = 0, j = 1; i < 48; i += 8, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -304,7 +307,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[6] = streebog512_hmac_ctx.opad.s[6];
tmps[gid].opad_raw[7] = streebog512_hmac_ctx.opad.s[7]; tmps[gid].opad_raw[7] = streebog512_hmac_ctx.opad.s[7];
streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
for (u32 i = 0, j = 1; i < 8; i += 8, j += 1) for (u32 i = 0, j = 1; i < 8; i += 8, j += 1)
{ {

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -355,7 +358,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[6] = streebog512_hmac_ctx.opad.s[6];
tmps[gid].opad_raw[7] = streebog512_hmac_ctx.opad.s[7]; tmps[gid].opad_raw[7] = streebog512_hmac_ctx.opad.s[7];
streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
u32 i = 0; u32 i = 0;
u32 j = 1; u32 j = 1;

@ -19,9 +19,12 @@
#include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl) #include M2S(INCLUDE_PATH/inc_cipher_kuznyechik.cl)
#endif #endif
#define VC_DATA_LEN (448)
#define VC_SALT_LEN ( 64)
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -420,7 +423,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[6] = streebog512_hmac_ctx.opad.s[6];
tmps[gid].opad_raw[7] = streebog512_hmac_ctx.opad.s[7]; tmps[gid].opad_raw[7] = streebog512_hmac_ctx.opad.s[7];
streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, 64); streebog512_hmac_update_global_swap (&streebog512_hmac_ctx, salt_bufs[SALT_POS_HOST].salt_buf, VC_SALT_LEN);
u32 i = 0; u32 i = 0;
u32 j = 1; u32 j = 1;

@ -49,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -69,7 +70,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -148,20 +149,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -283,7 +275,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -49,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -69,7 +70,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -148,20 +149,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -283,7 +275,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -49,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -69,7 +70,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -148,20 +149,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -283,7 +275,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -51,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc64_tmp typedef struct vc64_tmp
{ {
@ -71,7 +72,7 @@ typedef struct vc64_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -161,20 +162,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -296,7 +288,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -51,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc64_tmp typedef struct vc64_tmp
{ {
@ -71,7 +72,7 @@ typedef struct vc64_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -161,20 +162,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -296,7 +288,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -51,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc64_tmp typedef struct vc64_tmp
{ {
@ -71,7 +72,7 @@ typedef struct vc64_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -161,20 +162,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -296,7 +288,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -50,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -70,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -167,20 +168,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -302,7 +294,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -50,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -70,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -167,20 +168,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -302,7 +294,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -50,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -70,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -167,20 +168,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -302,7 +294,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -50,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -70,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -150,20 +151,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -285,7 +277,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -50,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -70,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -150,20 +151,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -285,7 +277,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -50,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -70,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -150,20 +151,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -285,7 +277,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -49,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -69,7 +70,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -167,20 +168,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -302,7 +294,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -49,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -69,7 +70,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -167,20 +168,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -302,7 +294,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -49,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -69,7 +70,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -167,20 +168,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -302,7 +294,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -50,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -70,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -169,20 +170,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -304,7 +296,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -50,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -70,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -169,20 +170,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -304,7 +296,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -50,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -70,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -169,20 +170,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -304,7 +296,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -51,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc64_sbog_tmp typedef struct vc64_sbog_tmp
{ {
@ -74,7 +75,7 @@ typedef struct vc64_sbog_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -153,20 +154,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -288,7 +280,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -51,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc64_sbog_tmp typedef struct vc64_sbog_tmp
{ {
@ -74,7 +75,7 @@ typedef struct vc64_sbog_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -153,20 +154,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -288,7 +280,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -51,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc64_sbog_tmp typedef struct vc64_sbog_tmp
{ {
@ -74,7 +75,7 @@ typedef struct vc64_sbog_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -153,20 +154,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -288,7 +280,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -52,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc64_sbog_tmp typedef struct vc64_sbog_tmp
{ {
@ -75,7 +76,7 @@ typedef struct vc64_sbog_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -155,20 +156,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -290,7 +282,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -52,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc64_sbog_tmp typedef struct vc64_sbog_tmp
{ {
@ -75,7 +76,7 @@ typedef struct vc64_sbog_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -155,20 +156,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -290,7 +282,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -52,9 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_DATA_LEN ( 448)
#define VC_HEADER_LEN 512 #define VC_HEADER_LEN ( 512)
#define VC_HEADER_HEX_LEN (VC_HEADER_LEN * 2)
typedef struct vc64_sbog_tmp typedef struct vc64_sbog_tmp
{ {
@ -75,7 +76,7 @@ typedef struct vc64_sbog_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -155,20 +156,11 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash) int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash)
{ {
const size_t st_hash_len = strlen (hashconfig->st_hash); char header[VC_HEADER_LEN + 1] = { 0 };
char *tmpdata = (char *) hcmalloc (st_hash_len / 2); hex_decode ((const u8 *) hashconfig->st_hash, VC_HEADER_HEX_LEN, (u8 *) header);
for (size_t i = 0, j = 0; j < st_hash_len; i += 1, j += 2) const int parser_status = module_hash_decode (hashconfig, hash->digest, hash->salt, hash->esalt, hash->hook_salt, hash->hash_info, header, VC_HEADER_LEN);
{
const u8 c = hex_to_u8 ((const u8 *) hashconfig->st_hash + j);
tmpdata[i] = c;
}
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; return parser_status;
} }
@ -290,7 +282,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }

@ -48,8 +48,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -67,7 +70,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -165,12 +168,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -182,12 +185,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -197,10 +195,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -220,7 +215,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -284,25 +279,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -48,8 +48,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -67,7 +70,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -165,12 +168,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -182,12 +185,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -197,10 +195,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -220,7 +215,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -284,25 +279,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -48,8 +48,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -67,7 +70,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -165,12 +168,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -182,12 +185,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -197,10 +195,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -220,7 +215,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -284,25 +279,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -50,8 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc64_tmp typedef struct vc64_tmp
{ {
@ -69,7 +72,7 @@ typedef struct vc64_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -176,12 +179,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -193,12 +196,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -208,10 +206,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -231,7 +226,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -295,25 +290,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -50,8 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc64_tmp typedef struct vc64_tmp
{ {
@ -69,7 +72,7 @@ typedef struct vc64_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -176,12 +179,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -193,12 +196,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -208,10 +206,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -231,7 +226,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -295,25 +290,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -50,8 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc64_tmp typedef struct vc64_tmp
{ {
@ -69,7 +72,7 @@ typedef struct vc64_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -176,12 +179,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -193,12 +196,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -208,10 +206,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -231,7 +226,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -295,25 +290,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -49,8 +49,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -68,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -152,12 +155,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -169,12 +172,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -184,10 +182,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -207,7 +202,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -271,25 +266,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -49,8 +49,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -68,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -152,12 +155,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -169,12 +172,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -184,10 +182,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -207,7 +202,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -271,25 +266,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -49,8 +49,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -68,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -166,12 +169,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -183,12 +186,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -198,10 +196,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -221,7 +216,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -285,25 +280,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -49,8 +49,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -68,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -167,12 +170,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -184,12 +187,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -199,10 +197,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -222,7 +217,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -286,25 +281,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -49,8 +49,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -68,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -167,12 +170,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -184,12 +187,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -199,10 +197,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -222,7 +217,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -286,25 +281,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -49,8 +49,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -68,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -167,12 +170,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -184,12 +187,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -199,10 +197,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -222,7 +217,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -286,25 +281,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -48,8 +48,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -67,7 +70,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -184,12 +187,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -201,12 +204,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -216,10 +214,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -239,7 +234,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -303,25 +298,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -48,8 +48,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -67,7 +70,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -184,12 +187,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -201,12 +204,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -216,10 +214,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -239,7 +234,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -303,25 +298,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -48,8 +48,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -67,7 +70,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -184,12 +187,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -201,12 +204,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -216,10 +214,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -239,7 +234,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -303,25 +298,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -49,8 +49,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -68,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -186,12 +189,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -203,12 +206,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -218,10 +216,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -241,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -305,25 +300,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -49,8 +49,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -68,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -186,12 +189,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -203,12 +206,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -218,10 +216,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -241,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -305,25 +300,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -49,8 +49,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc_tmp typedef struct vc_tmp
{ {
@ -68,7 +71,7 @@ typedef struct vc_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -186,12 +189,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -203,12 +206,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -218,10 +216,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -241,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -305,25 +300,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -49,8 +49,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc64_sbog_tmp typedef struct vc64_sbog_tmp
{ {
@ -71,7 +74,7 @@ typedef struct vc64_sbog_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -175,12 +178,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -192,12 +195,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -207,10 +205,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -230,7 +225,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -294,25 +289,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -49,8 +49,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc64_sbog_tmp typedef struct vc64_sbog_tmp
{ {
@ -71,7 +74,7 @@ typedef struct vc64_sbog_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -175,12 +178,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -192,12 +195,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -207,10 +205,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -230,7 +225,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -294,25 +289,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -49,8 +49,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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc64_sbog_tmp typedef struct vc64_sbog_tmp
{ {
@ -71,7 +74,7 @@ typedef struct vc64_sbog_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -181,12 +184,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -198,12 +201,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -213,10 +211,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -236,7 +231,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -300,25 +295,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -50,8 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc64_sbog_tmp typedef struct vc64_sbog_tmp
{ {
@ -72,7 +75,7 @@ typedef struct vc64_sbog_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -177,12 +180,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -194,12 +197,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -209,10 +207,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -232,7 +227,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -296,25 +291,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -50,8 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc64_sbog_tmp typedef struct vc64_sbog_tmp
{ {
@ -72,7 +75,7 @@ typedef struct vc64_sbog_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -177,12 +180,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -194,12 +197,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -209,10 +207,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -232,7 +227,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -296,25 +291,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -50,8 +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_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; } 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_SALT_LEN ( 64)
#define VC_DATA_LEN 448 #define VC_SALT_HEX_LEN (VC_SALT_LEN * 2)
#define VC_DATA_LEN ( 448)
#define VC_DATA_HEX_LEN (VC_DATA_LEN * 2)
typedef struct vc64_sbog_tmp typedef struct vc64_sbog_tmp
{ {
@ -72,7 +75,7 @@ typedef struct vc64_sbog_tmp
typedef struct vc typedef struct vc
{ {
u32 data_buf[112]; u32 data_buf[VC_DATA_LEN / 4];
u32 keyfile_buf16[16]; u32 keyfile_buf16[16];
u32 keyfile_buf32[32]; u32 keyfile_buf32[32];
u32 keyfile_enabled; u32 keyfile_enabled;
@ -177,12 +180,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
| TOKEN_ATTR_VERIFY_SIGNATURE; | TOKEN_ATTR_VERIFY_SIGNATURE;
token.sep[1] = '$'; token.sep[1] = '$';
token.len[1] = 128; token.len[1] = VC_SALT_HEX_LEN;
token.attr[1] = TOKEN_ATTR_FIXED_LENGTH token.attr[1] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
token.sep[2] = '$'; token.sep[2] = '$';
token.len[2] = 896; token.len[2] = VC_DATA_HEX_LEN;
token.attr[2] = TOKEN_ATTR_FIXED_LENGTH token.attr[2] = TOKEN_ATTR_FIXED_LENGTH
| TOKEN_ATTR_VERIFY_HEX; | TOKEN_ATTR_VERIFY_HEX;
@ -194,12 +197,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *salt_pos = token.buf[1]; const u8 *salt_pos = token.buf[1];
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8) salt->salt_len = hex_decode (salt_pos, VC_SALT_HEX_LEN, (u8 *) salt->salt_buf);
{
salt->salt_buf[i] = hex_to_u32 (salt_pos + j);
}
salt->salt_len = VC_SALT_LEN;
// iter // iter
@ -209,10 +207,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
const u8 *data_pos = token.buf[2]; const u8 *data_pos = token.buf[2];
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8) hex_decode (data_pos, VC_DATA_HEX_LEN, (u8 *) vc->data_buf);
{
vc->data_buf[i] = hex_to_u32 (data_pos + j);
}
// entropy // entropy
@ -232,7 +227,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// fake digest // fake digest
memcpy (digest, vc->data_buf, 112); memcpy (digest, vc->data_buf, VC_DATA_LEN / 4);
return (PARSER_OK); return (PARSER_OK);
} }
@ -296,25 +291,15 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
// salt // salt
#define SALT_HEX_LEN VC_SALT_LEN * 2 + 1 char salt_buf[VC_SALT_HEX_LEN + 1] = { 0 };
char salt_buf[SALT_HEX_LEN] = { 0 }; hex_encode ((const u8 *) salt->salt_buf, VC_SALT_LEN, (u8 *) salt_buf);
for (u32 i = 0, j = 0; i < VC_SALT_LEN / 4; i += 1, j += 8)
{
snprintf (salt_buf + j, SALT_HEX_LEN - j, "%08x", byte_swap_32 (salt->salt_buf[i]));
}
// data // data
#define DATA_HEX_LEN VC_DATA_LEN * 2 + 1 char data_buf[VC_DATA_HEX_LEN + 1] = { 0 };
char data_buf[DATA_HEX_LEN] = { 0 }; hex_encode ((const u8 *) vc->data_buf, VC_DATA_LEN, (u8 *) data_buf);
for (u32 i = 0, j = 0; i < VC_DATA_LEN / 4; i += 1, j += 8)
{
snprintf (data_buf + j, DATA_HEX_LEN - j, "%08x", byte_swap_32 (vc->data_buf[i]));
}
// output // output

@ -1,5 +1,10 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
#
# Author......: See docs/credits.txt
# License.....: MIT
#
from argparse import ArgumentParser, ArgumentTypeError from argparse import ArgumentParser, ArgumentTypeError
@ -23,9 +28,10 @@ def validate_offset(offset):
offset = BOOTABLE_OFFSET + HIDDEN_OFFSET offset = BOOTABLE_OFFSET + HIDDEN_OFFSET
try: try:
offset = int(offset) offset = int(offset)
assert offset >= 0 except ValueError as e:
except (AssertionError, ValueError): raise ArgumentTypeError("value is nether number nor allowed string") from e
raise ArgumentTypeError("offset is nether non-negative number nor bootable, hidden or bootable+hidden value") if offset < 0:
raise ArgumentTypeError("value cannot be less than zero")
return offset return offset
@ -42,14 +48,18 @@ if __name__ == "__main__":
args = parser.parse_args() args = parser.parse_args()
with open(args.path, "rb") as file: try:
file.seek(args.offset) with open(args.path, "rb") as file:
file.seek(args.offset)
header = file.read(HEADER_LENGTH) header = file.read(HEADER_LENGTH)
assert len(header) == HEADER_LENGTH, "less data than needed" if len(header) < HEADER_LENGTH:
parser.error("file contains less data than needed")
salt, data = header[:SALT_LENGTH], header[SALT_LENGTH:] salt, data = header[:SALT_LENGTH], header[SALT_LENGTH:]
hash = SIGNATURE + salt.hex() + "$" + data.hex() hash = SIGNATURE + salt.hex() + "$" + data.hex()
print(hash) print(hash)
except IOError as e:
parser.error(e.strerror.lower())

Loading…
Cancel
Save