all computation on unsigned

This commit is contained in:
Francois Perrad 2019-10-06 16:09:48 +02:00
parent d2b739ee18
commit 62a09c66ca

View File

@ -6,8 +6,7 @@
/* get the size for an unsigned equivalent */
size_t mp_ubin_size(const mp_int *a)
{
int size = mp_count_bits(a);
size = (size / 8) + ((((unsigned)size & 7u) != 0u) ? 1 : 0);
return (size_t)size;
size_t size = (size_t)mp_count_bits(a);
return (size / 8u) + (((size & 7u) != 0u) ? 1u : 0u);
}
#endif