magnumripper/JohnTheRipper — pull request #567 by hantwister (2014-04-14 18:21:24+00:00)
Title: Intel AES-NI sample library and consolidated o5logon formats

OK, so this pull request:

-Adds portions of Intel's AES-NI sample code to the tree, and removes the Intel-processor-specific check so it works on AMD too
-Will only attempt to compile Intel's sample code on x86 and x64, and if software prerequisites* are met
-Adds a wrapper that uses Intel's AES-NI if available, and uses the older OpenSSL AES methods otherwise
-Ditches the AES-NI specific formats I added for o5logon
-Has o5logon and o5logon-opencl use the wrapper mentioned above

*Intel uses yasm to build their assembly files in the sample library, so I simply did the same. If yasm isn't present, the Makefile will quietly ignore the Intel code. Also, Intel claims that GCC should be at least 4.4, so the Makefile checks for that too. Finally, I don't have non-Linux boxes immediately at my disposal, so for the moment it only builds Intel's code on Linux; it should be easy enough to extend it to other OSes once we know it works.

On older computers I have access to, using the wrapper that simply calls the OpenSSL AES functions like before seems to only sacrifice performance by about 2%. That said, on the newer machine with AES-NI in front of me, o5logon is now 50% faster than the now removed o5logon-aesni, and o5logon-opencl is more than twice as fast as the now removed o5logon-opencl-aesni.

I checked it with OMP and it works fine.

As an aside: rumor has it that Intel will be releasing processors with SHA-specific instructions next year or the year after, and with any luck the performance boost will be just as nice as with the AES-specific instructions.