ECCSI and SAKKE: add support

Fixes for static code analysis included.
Added const to function parameters.
Zeroise some temporaries.
This commit is contained in:
Sean Parkinson
2021-01-12 12:25:52 +10:00
parent c091b968a3
commit a55e94cf6f
79 changed files with 225927 additions and 21958 deletions

View File

@@ -238,7 +238,7 @@ void mp_forcezero(mp_int * a)
/* get the size for an unsigned equivalent */
int mp_unsigned_bin_size (mp_int * a)
int mp_unsigned_bin_size (const mp_int * a)
{
int size = mp_count_bits (a);
return (size / 8 + ((size & 7) != 0 ? 1 : 0));
@@ -246,7 +246,7 @@ int mp_unsigned_bin_size (mp_int * a)
/* returns the number of bits in an int */
int mp_count_bits (mp_int * a)
int mp_count_bits (const mp_int * a)
{
int r;
mp_digit q;
@@ -350,7 +350,7 @@ int mp_init_copy (mp_int * a, mp_int * b)
/* copy, b = a */
int mp_copy (mp_int * a, mp_int * b)
int mp_copy (const mp_int * a, mp_int * b)
{
int res, n;