lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 4 Oct 2015 02:24:05 +0200
From: Thomas Pornin <pornin@...et.org>
To: discussions@...sword-hashing.net
Subject: Re: [PHC] Specification of a modular crypt format (2)

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.


	--Thomas Pornin

Powered by blists - more mailing lists