On Nov 10, 9:26 am, Xiaohui Liu <[email protected]> wrote:
> Thank you guys. your feedbacks are very helpful.
>
> It turns out one way to achieve this is to generate a random number and
> conduct primality test by using "IsPrime()" function available in
> "nbtheory.h".
>
>

// nbtheory.cpp
bool VerifyPrime(RandomNumberGenerator &rng, const Integer &p,
unsigned int level)
{
    bool pass = IsPrime(p) && RabinMillerTest(rng, p, 1);
    if (level >= 1)
        pass = pass && RabinMillerTest(rng, p, 10);

    return pass;
}

-- 
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.

Reply via email to