Skip to content

Commit

Permalink
dynamic problems on BE due to recent optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
jfoug committed Jul 13, 2015
1 parent 8023410 commit 041fbae
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 6 deletions.
27 changes: 27 additions & 0 deletions run/dynamic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,15 @@ MaxInputLen=55
MaxInputLenX86=110
Func=DynamicFunc__crypt_md5
Func=DynamicFunc__overwrite_from_last_output_to_input2_as_base16_no_size_fix
#if !ARCH_LITTLE_ENDIAN // unfortunatly, we have no #define here, so we always have to call this function, in a script or they will fail on BE boxes :(
Func=DynamicFunc__set_input2_len_32
#endif
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt_md5_in2_to_out1
Test=$dynamic_1001$57200e13b490d4ae47d5e19be026b057:test1
Test=$dynamic_1001$c6cc44f9e7fb7efcde62ba2e627a49c6:thatsworking
Expand All @@ -88,12 +93,16 @@ MaxInputLenX86=110
# here is the optimized 'script' to perform the md5 5 times on itself.
Func=DynamicFunc__crypt_md5
Func=DynamicFunc__overwrite_from_last_output_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt_md5_in2_to_out1
# These are test strings for this format.
Test=$dynamic_1002$25de8cd0b0cf69c5b5bc19c8ee64adab:test1
Expand Down Expand Up @@ -149,14 +158,19 @@ MaxInputLenX86=110
# here is the optimized 'script' to perform the md5 6 times on itself.
Func=DynamicFunc__crypt_md5
Func=DynamicFunc__overwrite_from_last_output_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt_md5_in2_to_out1
# These are test strings for this format.
Test=$dynamic_1004$de1b991dd27fb9813e88b957a455dccd:test1
Expand All @@ -179,16 +193,22 @@ MaxInputLenX86=110
# here is the optimized 'script' to perform the md5 7 times on itself.
Func=DynamicFunc__crypt_md5
Func=DynamicFunc__overwrite_from_last_output_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt_md5_in2_to_out1
# These are test strings for this format.
Test=$dynamic_1005$784c527d0d92873ff9c0773e1c35621d:test1
Expand All @@ -210,18 +230,25 @@ MaxInputLenX86=110
# here is the optimized 'script' to perform the md5 8 times on itself.
Func=DynamicFunc__crypt_md5
Func=DynamicFunc__overwrite_from_last_output_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt2_md5
Func=DynamicFunc__overwrite_from_last_output2_to_input2_as_base16_no_size_fix
Func=DynamicFunc__set_input2_len_32
Func=DynamicFunc__crypt_md5_in2_to_out1
# These are test strings for this format.
Test=$dynamic_1006$1ec1f32398f64cab51183f63630eceea:test1
Expand Down
23 changes: 17 additions & 6 deletions src/dynamic_preloads.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,13 @@ static DYNAMIC_primitive_funcp _Funcs_2[] =
//MGF_SET_INP2LEN32
DynamicFunc__crypt_md5,
DynamicFunc__overwrite_from_last_output_to_input2_as_base16_no_size_fix,
// DynamicFunc__set_input2_len_32,
#if !ARCH_LITTLE_ENDIAN
// Not sure WHY this is needed in BE systems, BUT it is???
// it does do a memset on last part of buffer, but 'why' is that needed???
// we should have a fixed length of 32 bytes set, so not sure why we need
// to continue to clear on these formats.
DynamicFunc__set_input2_len_32,
#endif

DynamicFunc__crypt_md5_in2_to_out1,
NULL
Expand All @@ -248,6 +254,7 @@ static struct fmt_tests _Preloads_2[] =
{"$dynamic_2$418d89a45edadb8ce4da17e07f72536c","test1"},
{"$dynamic_2$ccd3c4231a072b5e13856a2059d04fad","thatsworking"},
{"$dynamic_2$9992295627e7e7162bdf77f14734acf8","test3"},
{"$dynamic_2$74be16979710d4c4e7c6647856088456",""},
#ifdef DEBUG
{"$dynamic_2$4da0b552b078998f671795b925aed4ae","1234567890123456789012345678901234567890123456789012345"},
#ifndef SIMD_COEF_32
Expand All @@ -263,12 +270,14 @@ static DYNAMIC_primitive_funcp _Funcs_3[] =
//MGF_SET_INP2LEN32
DynamicFunc__crypt_md5,
DynamicFunc__overwrite_from_last_output_to_input2_as_base16_no_size_fix,
// DynamicFunc__set_input2_len_32,

#if !ARCH_LITTLE_ENDIAN
DynamicFunc__set_input2_len_32,
#endif
DynamicFunc__crypt2_md5,
DynamicFunc__overwrite_from_last_output2_as_base16_no_size_fix,
// DynamicFunc__set_input2_len_32,

#if !ARCH_LITTLE_ENDIAN
DynamicFunc__set_input2_len_32,
#endif
DynamicFunc__crypt_md5_in2_to_out1,
NULL
};
Expand Down Expand Up @@ -991,7 +1000,9 @@ static DYNAMIC_primitive_funcp _Funcs_34[] =
//DynamicFunc__clean_input2_kwik,
//DynamicFunc__append_from_last_output_to_input2_as_base16,
DynamicFunc__overwrite_from_last_output_to_input2_as_base16_no_size_fix,
// DynamicFunc__set_input2_len_32,
#if !ARCH_LITTLE_ENDIAN
DynamicFunc__set_input2_len_32,
#endif
DynamicFunc__crypt_md5_in2_to_out1,
NULL
};
Expand Down

0 comments on commit 041fbae

Please sign in to comment.