Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <05ED43E9-9BFD-49A2-8010-8D2AF2C8723A@gmail.com>
Date: Fri, 21 Aug 2015 17:44:56 +0800
From: Lei Zhang <zhanglei.april@...il.com>
To: john-dev@...ts.openwall.com
Subject: Unaligned access (was: JtR on ARM)

Hi,

I just update a bunch of formats to avoid unaligned accesses when ARCH_ALLOWS_UNALIGNED = 0. All unaligned accesses observed so far happen in set_key(char *key, int), where 'key'  might be cast to an int-type pointer. To avoid unaligned access, I create a buffer that is properly aligned, strcpy key to that buffer and then use this buffer as replacement. It is questionable which kind of overhead is higher: unaligned access or redundant 'strcpy's. I tested it on Power, and here's the result:

[ARCH_ALLOWS_UNALIGNED = 1]
Benchmarking: Raw-MD4 [MD4 128/128 AltiVec 4x]... DONE
Raw:	14005K c/s real, 14146K c/s virtual

Benchmarking: Raw-MD5 [MD5 128/128 AltiVec 4x]... DONE
Raw:	13777K c/s real, 13777K c/s virtual

Benchmarking: Raw-SHA1 [SHA1 128/128 AltiVec 4x]... DONE
Raw:	7733K c/s real, 7733K c/s virtual

Benchmarking: Raw-SHA256 [SHA256 128/128 AltiVec 4x]... DONE
Raw:	3130K c/s real, 3161K c/s virtual

Benchmarking: Raw-SHA512 [SHA512 128/128 AltiVec 2x]... DONE
Raw:	1320K c/s real, 1333K c/s virtual

[ARCH_ALLOWS_UNALIGNED = 0]
Benchmarking: Raw-MD4 [MD4 128/128 AltiVec 4x]... DONE
Raw:	12504K c/s real, 12631K c/s virtual

Benchmarking: Raw-MD5 [MD5 128/128 AltiVec 4x]... DONE
Raw:	3898K c/s real, 3937K c/s virtual

Benchmarking: Raw-SHA1 [SHA1 128/128 AltiVec 4x]... DONE
Raw:	5215K c/s real, 5268K c/s virtual

Benchmarking: Raw-SHA256 [SHA256 128/128 AltiVec 4x]... DONE
Raw:	3924K c/s real, 3963K c/s virtual

Benchmarking: Raw-SHA512 [SHA512 128/128 AltiVec 2x]... DONE
Raw:	1178K c/s real, 1178K c/s virtual

Only raw-sha256 gets faster after forcing aligned accesses. raw-md5 even gets a lot slower. The situation might be different on other archs though.


Lei 

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.