1 /* 2 * rawsha1 cracker patch for JtR, common code. 2015 by JimF 3 * This file takes replicated but common code, shared between the CPU 4 * and the GPU formats, and places it into one common location 5 */ 6 7 #if !defined (rawsha1_common_h__) 8 #define rawsha1_common_h__ 9 10 #include "arch.h" 11 #include "formats.h" 12 13 #define FORMAT_TAG "$dynamic_26$" 14 #define TAG_LENGTH (sizeof(FORMAT_TAG)-1) 15 #define FORMAT_TAG_OLD "{SHA}" 16 #define TAG_LENGTH_OLD (sizeof(FORMAT_TAG_OLD)-1) 17 18 #define HASH_LENGTH 40 19 #define HASH_LENGTH_OLD 28 20 #define CIPHERTEXT_LENGTH (HASH_LENGTH + TAG_LENGTH) 21 22 #define DIGEST_SIZE 20 23 #define AX_DIGEST_SIZE 16 24 #define SALT_SIZE 0 25 #define SALT_ALIGN 1 26 27 extern struct fmt_tests rawsha1_common_tests[]; 28 extern struct fmt_tests axcrypt_common_tests[]; 29 30 int rawsha1_common_valid(char *ciphertext, struct fmt_main *self); 31 char *rawsha1_common_split(char *ciphertext, int index, struct fmt_main *self); 32 char *rawsha1_common_prepare(char *split_fields[10], struct fmt_main *self); 33 void *rawsha1_common_get_rev_binary(char *ciphertext); 34 void *rawsha1_common_get_binary(char *ciphertext); 35 int rawsha1_axcrypt_valid(char *ciphertext, struct fmt_main *self); 36 char *rawsha1_axcrypt_split(char *ciphertext, int index, struct fmt_main *self); 37 38 #endif // #define rawsha1_common_h__ 39