[PATCH] MPI helper of addition one limb, Least Leak Intended

Jacob Bachmeyer jcb62281 at gmail.com
Fri Feb 14 07:08:20 CET 2025


On 2/13/25 23:41, Jussi Kivilinna wrote:
> On 14.2.2025 6.57, Jacob Bachmeyer via Gcrypt-devel wrote:
>> [...]
>>
>> If I read this correctly, the carry handling is depending on integer 
>> overflow wrapping around, which is not actually defined behavior in 
>> C, although most platforms do handle it that way. Do we have an 
>> MPI_LIMB_MAX constant analogous to INT_MAX but for mpi_limb_t instead 
>> of int?
>>
>
> Limbs are unsigned integers and unsigned integer overflow is defined 
> behavior.

Aha... I had forgotten that unsigned integers do wrap.  Thank you.


-- Jacob





More information about the Gcrypt-devel mailing list