do 2 MR rounds for numbers >=2048bits

This commit is contained in:
Steffen Jaeckel 2019-05-18 12:22:47 +02:00
parent d46cb169f8
commit 1cbfbe069e

View File

@ -19,8 +19,7 @@ static const struct {
{ 768, 5 },
{ 896, 4 },
{ 1024, 4 },
{ 2048, 2 },
{ 4096, 1 },
{ 2048, 2 } /* For bigger keysizes use always at least 2 Rounds */
};
/* returns # of RM trials required for a given bit size and max. error of 2^(-96)*/
@ -35,7 +34,7 @@ int mp_prime_rabin_miller_trials(int size)
return (x == 0) ? sizes[0].t : sizes[x - 1].t;
}
}
return sizes[x-1].t + 1;
return sizes[x-1].t;
}