MD5 speed improvement ideas
#16
(10-17-2010, 10:42 AM)atom Wrote: i guess this was already optimized by compilers. hashcat supports pw length up to 55 chars and i think it should so that means that i can not apply this optimization on hashcat. thanks again! your stuff rock :-)

It CAN be applied, you will still be able to compute 55 char hashes. By implementing the previous idea, you just insert ONLY one IF statement (overhead of approx. 4 instuctions) for each 4 SSE2 packed passwords to decide if full 55 char MD5 or simplified MD5 function can be executed. MD5 simplified for up to 31 chars means 28 LESS instructions, much more than previous tips! If only I can have acces to the source code Smile

Also, it can't be optimized by compiler (still speaking about CPU version), because compiler doesn't know the lenghts of computed passwords - they are known in run-time, not in compile time.

If you want something specific to GPU, here it is Smile I have examined the *.kernel files which are provided with oclHashcat and also examined document ptx_isa_1.3.pdf by nVidia to see the whole instruction set and voila, an idea...
There is MAD instruction (page 51) which performs multiplication and addition, so you can improve the bit rotation operation. Bit shifting by n is the same operation as multiplying by 2^n, so an example written in C:

Code:
    tmp = a >> 25;
    a   = a << 7;
    a   = a | tmp;
can be, of course, written also as
Code:
    tmp = a >> 25;
    a   = a * 128;
    a   = a + tmp;
Last two lines can be computed by one MAD instruction. In CUDA PTX assembly, it could looks like this...
Before optimization:
Code:
    shr.u32     %r201, %r200, 25;
    shl.b32     %r202, %r200, 7;
    or.b32      %r203, %r202, %r201;
Optimized code:
Code:
    shr.u32    %r201, %r200, 25;
    mad.u32    %r202, %r200, 128, %201
Maybe the syntax is wrong... I can't test it, because I'm not familiar with CUDA yet, I bought my first CUDA card - GTX450 just 2 weeks ago Big Grin
Reply


Messages In This Thread
MD5 speed improvement ideas - by Dalibor - 10-09-2010, 08:54 PM
RE: MD5 speed improvement ideas - by D3ad0ne - 10-09-2010, 10:37 PM
RE: MD5 speed improvement ideas - by Dalibor - 10-10-2010, 09:00 AM
RE: MD5 speed improvement ideas - by ksp - 10-10-2010, 09:54 AM
RE: MD5 speed improvement ideas - by atom - 10-10-2010, 10:53 AM
RE: MD5 speed improvement ideas - by Dalibor - 10-10-2010, 10:49 PM
RE: MD5 speed improvement ideas - by atom - 10-11-2010, 12:37 PM
RE: MD5 speed improvement ideas - by Dalibor - 10-11-2010, 10:46 PM
RE: MD5 speed improvement ideas - by atom - 10-13-2010, 10:14 AM
RE: MD5 speed improvement ideas - by Dalibor - 10-14-2010, 03:02 PM
RE: MD5 speed improvement ideas - by atom - 10-15-2010, 01:11 PM
RE: MD5 speed improvement ideas - by atom - 10-15-2010, 03:26 PM
RE: MD5 speed improvement ideas - by Dalibor - 10-16-2010, 12:43 AM
RE: MD5 speed improvement ideas - by D3ad0ne - 10-16-2010, 12:33 AM
RE: MD5 speed improvement ideas - by atom - 10-17-2010, 10:42 AM
RE: MD5 speed improvement ideas - by Dalibor - 10-17-2010, 04:19 PM
RE: MD5 speed improvement ideas - by IvanG - 10-17-2010, 08:12 PM
RE: MD5 speed improvement ideas - by Dalibor - 11-01-2010, 11:15 AM
RE: MD5 speed improvement ideas - by Rolf - 10-17-2010, 04:55 PM
RE: MD5 speed improvement ideas - by D3ad0ne - 10-17-2010, 07:33 PM
RE: MD5 speed improvement ideas - by IvanG - 12-14-2010, 06:55 PM