Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 7 Jul 2012 11:00:49 -0500
From: "jfoug" <>
To: <>
Subject: RE: Build error for generic (was: SHA2 added to bleeding)

>From: Frank Dittrich []
>On 06/30/2012 06:13 PM, jfoug wrote:
>> I have added sha2.c and sha2.h and modified a lot of formats, to
>> remove the oSSL version dependency for SHA224/256/384/512 from JtR.
>Now that this has arrived in magnum-jumbo, building generic on my 32bit
>Linux system fails:

I have changed the macro, from using the uintptr_t to using ARCH_WORD.   I
am pretty sure this will be adequate, since we are already properly (I hope)
using the proper machine sized int for ARCH_WORD.  The proper machine sized
int was what uintptr_t was supposed to be.

I also changed code in the non-aligned CPU part of memory.c (in the
non-aligned CPU's alter endianity), to use the is_aligned macro.   This
should help any problems show up faster.

The only 2 usages of this macro, are wrapped with #define
!ARCH_ALLOWS_UNALIGNED.   That the generic build of linux uses this SLOWER
code bothers me.  I think we should look at adding at least that much smarts
to the generic build.  It can easily detect the ARCH_ALLOWS_UNALIGNED by
checking these (likely not all encompassing, but it would catch it MOST of
the time)

#if defined(i386) || defined(__i386__) || defined(__i486__) || \
	defined(__i586__) || defined(__i686__) || defined(__pentium__) || \
	defined(__pentiumpro__) || defined(__pentium4__) || \
	defined(__nocona__) || defined(prescott) || defined(__core2__) || \
	defined(__k6__) || defined(__k8__) || defined(__athlon__) || \
	defined(__amd64) || defined(__amd64__) || \
	defined(__x86_64) || defined(__x86_64__) || defined(_M_IX86) || \
	defined(_M_AMD64) || defined(_M_IA64) || defined(_M_X64)

There is no reason to always generically use ARCH_ALLOWS_UNALIGNED 0    I
can easily 'fix' detect.c to output a 0 or 1, depending upon the above
defines.  This should improve the speed of generic builds for any Intel/AMD
CPU listed.  Certainly, will improve speed of most any dynamic format, if a
generic build was done, on a CPU allowing non-aligned access.


Download attachment "JtR-bleed-align-macro-fix-1.diff" of type "application/octet-stream" (1157 bytes)

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.