Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 18 Mar 2015 14:42:52 +0300
From: Alexander Cherepanov <ch3root@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: Re: 256/128 bit integer arithmatic

On 2015-03-17 11:07, magnum wrote:
> #define UINT128_MAX             ((uint128_t)-1)
>
> That last line is because we can't (even in gcc-5 afaik) express
> constants larger than ULL. We could set a positive number using shifts
> but the above works fine.

If the rules for uint128_t are the same as for other unsigned types in C 
then ((uint128_t)-1) is a valid and probably the cleanest way to express 
UINT128_MAX.

-- 
Alexander Cherepanov

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ