[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compile errors


Hi George,

Not our code but part of ed25519 signature scheme. I guess the goal is
to get two's complement to m, i.e. m = (~m) -1;

It's crypto code so I wouldn't dare touching this unless we're certain
it's issuing wrong code or the result is undefined.

Aris

On 1/04/17 18:00, George M. Garner Jr. wrote:
> When I compile libssh 7.5 with the VS2015 compiler I get the following
> two warnings:
>
> fe25519.c(92):
> warning C4146: unary minus operator applied to unsigned type, result
> still unsigned
>
> fe25519.c(145): warning C4146: unary minus operator applied to
> unsigned type, result still unsigned
>
> The two lines of code are:
>
>
> m = -m;
>
> and
>
> mask = -mask;
>
> where both m and mask are defined as crypto_uint32.  What is the
> intended result of apply a unary minus operator to the unsigned types?
>
> m = (uint32_t) ( -(int32_t)m);
>
>
> Regards,
>
> George M. Garner Jr.
>
>
>


References:
Re: compile errors"George M. Garner Jr." <ggarner_online@xxxxxxxxxxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org