Re: Somewhat Puzzline Error

From: Cy Schubert <Cy.Schubert_at_cschubert.com>
Date: Thu, 15 May 2025 05:18:04 UTC
In message <CANCZdfr63OSMwJTx0rKPtrVtNNhVYe9Y9qd8ODbi4Vx3Hc_xYw@mail.gmail.c
om>
, Warner Losh writes:
> --000000000000defb400635210eed
> Content-Type: text/plain; charset="UTF-8"
> Content-Transfer-Encoding: quoted-printable
>
> On Wed, May 14, 2025, 5:23=E2=80=AFPM Cy Schubert <Cy.Schubert@cschubert.co=
> m> wrote:
>
> > On 32-bit platforms, given this definition,
> >
> > typedef uint128_t fiat_25519_uint128;
> >
> > The following should be ok.
> >
> >   fiat_25519_uint128 x26 =3D (x25 + (x10 + (x9 + (x7 + x4))));
> >   uint64_t x27 =3D (uint64_t)(x26 >> 51);
> >
> > But on 32-bit platforms only this results in the following error.
> >
> > In file included from
> > /home/cy/src-krb5/crypto/krb5/src/plugins/preauth/spake/ed
> > wards25519.c:193:
> >
> > /home/cy/src-krb5/crypto/krb5/src/plugins/preauth/spake/edwards25519_fiat=
> .h:101:
> > 33: error: shift count >=3D width of type [-Werror,-Wshift-count-overflow=
> ]
> >   101 |   uint64_t x27 =3D (uint64_t)(x26 >> 51);
> >       |                                 ^  ~~
> > x26 should be 128 bits. Or is uint128_t not 128 bits on 32-bit platforms?
> >
> > Of course there is no error on 64-bit platforms.
> >
>
> There may be a hack for that sonce __int128_t didn't work on i386. But that
> was confined to nvmecontrol i though. I don't see where we define
> uint128_t...

I'll stand up an i386 jail and install/test the port in it. Upstream could 
be working around this somehow. And if they are I'll need to duplicate it.


-- 
Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  https://FreeBSD.org
NTP:           <cy@nwtime.org>    Web:  https://nwtime.org

			e^(i*pi)+1=0