MD5 speed improvement ideas
#20
(10-17-2010, 08:12 PM)IvanG Wrote: Unfortunately this won't work as integer MAD is just a virtual instruction. PTX isn't real assembler...
Shortly, NVCC compiler is smart enough to make rotates as fast as possible, no need for special actions from programmer.
Thanks for explanation, Ivan. So it was false alarm, same as with BFI_INT instruction, which I have found in AMD Evergreen ISA reference guide, it can compute (A & B) | (~A & c), function bitselect() in OpenCL should be translated into this instruction... But it seems that compilers are better than I presume Smile

And now only theoretical, "academical" tip (maybe usefull for you, Ivan Smile) not applicable to hashcat.
If someone is cracking only 1 (resp. 4) hashes, the common way is to reverse hash down to step 49, then start computing hash from the beginning to step 45, then compare variable A. So we are meeting in the middle in 45th step.
But look at the constant at step 18
Code:
0xc040b340 = 11000000010000001011001101000000
There are six 0's at the end! Step 18:
Code:
d += G(a,b,c) + password[6];
d += ...01000000;
d = ((d<<9) | (d>>23))
d += a;
Last 6 bits of 'd' will not be affected by adding this constant. Then the result is rotated by 9 bits, so after rotation, we know, that bits at positions 15 - 9 (counting from zero) remains the same.
So we can avoid this addition and rotation by meeting in the middle just in this step... Hope you got the idea...

There is of course little overhead needed, but maybe it is possible to save at least one instruction by properly implementing this idea :-)
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