Somewhat Puzzline Error

From: Cy Schubert <Cy.Schubert_at_cschubert.com>
Date: Wed, 14 May 2025 23:22:47 UTC
On 32-bit platforms, given this definition,

typedef uint128_t fiat_25519_uint128;

The following should be ok.

  fiat_25519_uint128 x26 = (x25 + (x10 + (x9 + (x7 + x4))));
  uint64_t x27 = (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 >= width of type [-Werror,-Wshift-count-overflow]
  101 |   uint64_t x27 = (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.


-- 
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