[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56170750.3060207@openwall.com>
Date: Fri, 09 Oct 2015 03:16:16 +0300
From: Alexander Cherepanov <ch3root@...nwall.com>
To: discussions@...sword-hashing.net
Subject: Re: [PHC] Specification of a modular crypt format (2)
On 2015-10-04 03:24, Thomas Pornin wrote:
> On Sun, Oct 04, 2015 at 03:07:07AM +0300, Alexander Cherepanov wrote:
>> but if value > INT_MAX / 10 the result of multiplication is "not in
>> the range of representable values for its type". This is an
>> undefined behavior and the result of the whole program run is
>> undefined (nasal demons et al.).
>
> As an added information, consider that clang and gcc can be invoked
> with the "-ftrapv" command-line option; with that option, the generated
> code specifically checks for overflows on signed integers (for
> additions, subtractions and multiplications, says the gcc
> documentation). When an overflow occurs, a trap is triggered (on x86,
> this uses the 'ud2' pseudo-opcode).
>
> I don't think that flag is much used in deployed software, but it can be
> convenient for testing.
Yes, a nice option. Beware though that it doesn't work in 64-bit mode
for gcc at least up to version 4.9:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52478
--
Alexander Cherepanov
Powered by blists - more mailing lists