RSAKeyPairGenerator.millerRabinBase
Maps random octets to a Miller-Rabin witness base.
The base is reduced into [2, n-2]: reducing modulo n-3 (rather than n-2) keeps the degenerate witness a = n-1 out of the pool, since (-1)^d is always +-1 and proves nothing.
Parameters
buf | Fresh random octets. |
n | The odd candidate under test (n > 4). |
Returns
A witness base a with 2 <= a <= n-2.