mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-16 02:27:32 -05:00
Add some tests of Miller-Rabin to cryptsuite.
I'm about to rewrite the Miller-Rabin testing code, so let's start by introducing a test suite that the old version passes, and then I can make sure the new one does too.
This commit is contained in:
@ -94,6 +94,14 @@ typedef struct MillerRabin MillerRabin;
|
||||
MillerRabin *miller_rabin_new(mp_int *p);
|
||||
void miller_rabin_free(MillerRabin *mr);
|
||||
|
||||
/* Perform a single Miller-Rabin test, using a specified witness value.
|
||||
* Used in the test suite. */
|
||||
struct mr_result {
|
||||
bool passed;
|
||||
bool potential_primitive_root;
|
||||
};
|
||||
struct mr_result miller_rabin_test(MillerRabin *mr, mp_int *w);
|
||||
|
||||
/* Perform a single Miller-Rabin test, using a random witness value. */
|
||||
bool miller_rabin_test_random(MillerRabin *mr);
|
||||
|
||||
|
Reference in New Issue
Block a user