Add generic_salt_encode so we have both function types

This commit is contained in:
jsteube
2019-02-14 10:52:24 +01:00
parent 6f4b72bcd3
commit 0096f1a56b
13 changed files with 89 additions and 98 deletions

View File

@@ -90,6 +90,7 @@ const char *strhashcategory (const u32 hash_category);
const char *stroptitype (const u32 opti_type);
bool generic_salt_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, const u8 *in_buf, const int in_len, u8 *out_buf, int *out_len);
int generic_salt_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, const u8 *in_buf, const int in_len, u8 *out_buf);
int input_tokenizer (const u8 *input_buf, const int input_len, token_t *token);

View File

@@ -391,26 +391,24 @@ typedef enum opts_type
OPTS_TYPE_ST_ADD80 = (1ULL << 22),
OPTS_TYPE_ST_ADDBITS14 = (1ULL << 23),
OPTS_TYPE_ST_ADDBITS15 = (1ULL << 24),
OPTS_TYPE_ST_GENERATE_LE = (1ULL << 25),
OPTS_TYPE_ST_GENERATE_BE = (1ULL << 26),
OPTS_TYPE_ST_HEX = (1ULL << 27),
OPTS_TYPE_ST_BASE64 = (1ULL << 28),
OPTS_TYPE_ST_HASH_MD5 = (1ULL << 29),
OPTS_TYPE_HASH_COPY = (1ULL << 30),
OPTS_TYPE_HASH_SPLIT = (1ULL << 31),
OPTS_TYPE_HOOK12 = (1ULL << 32),
OPTS_TYPE_HOOK23 = (1ULL << 33),
OPTS_TYPE_INIT2 = (1ULL << 34),
OPTS_TYPE_LOOP2 = (1ULL << 35),
OPTS_TYPE_AUX1 = (1ULL << 36),
OPTS_TYPE_AUX2 = (1ULL << 37),
OPTS_TYPE_AUX3 = (1ULL << 38),
OPTS_TYPE_AUX4 = (1ULL << 39),
OPTS_TYPE_BINARY_HASHFILE = (1ULL << 40),
OPTS_TYPE_PREFERED_THREAD = (1ULL << 41), // some algorithms (complicated ones with many branches) benefit from this
OPTS_TYPE_PT_ADD06 = (1ULL << 42),
OPTS_TYPE_KEYBOARD_MAPPING = (1ULL << 43),
OPTS_TYPE_DEEP_COMP_KERNEL = (1ULL << 44), // if we have to iterate through each hash inside the comp kernel, for example if each hash has to be decrypted separately
OPTS_TYPE_ST_HEX = (1ULL << 25),
OPTS_TYPE_ST_BASE64 = (1ULL << 26),
OPTS_TYPE_ST_HASH_MD5 = (1ULL << 27),
OPTS_TYPE_HASH_COPY = (1ULL << 28),
OPTS_TYPE_HASH_SPLIT = (1ULL << 29),
OPTS_TYPE_HOOK12 = (1ULL << 30),
OPTS_TYPE_HOOK23 = (1ULL << 31),
OPTS_TYPE_INIT2 = (1ULL << 32),
OPTS_TYPE_LOOP2 = (1ULL << 33),
OPTS_TYPE_AUX1 = (1ULL << 34),
OPTS_TYPE_AUX2 = (1ULL << 35),
OPTS_TYPE_AUX3 = (1ULL << 36),
OPTS_TYPE_AUX4 = (1ULL << 37),
OPTS_TYPE_BINARY_HASHFILE = (1ULL << 38),
OPTS_TYPE_PREFERED_THREAD = (1ULL << 39), // some algorithms (complicated ones with many branches) benefit from this
OPTS_TYPE_PT_ADD06 = (1ULL << 40),
OPTS_TYPE_KEYBOARD_MAPPING = (1ULL << 41),
OPTS_TYPE_DEEP_COMP_KERNEL = (1ULL << 42), // if we have to iterate through each hash inside the comp kernel, for example if each hash has to be decrypted separately
} opts_type_t;