0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::openssl: Add yield points to genprime routine.

This commit is contained in:
Jason Volk 2018-08-28 13:13:20 -07:00
parent 1bd130bf94
commit 89fbab2d7a

View file

@ -1805,16 +1805,28 @@ ircd::openssl::genprime_cb(const int stat,
{
assert(ctx != nullptr);
auto &arg{ctx->arg};
const auto yield_point{[]
{
if(ctx::current)
ctx::yield();
}};
switch(stat)
{
case 0: // generating i-th potential prime
return true;
case 1: // testing i-th potential prime
{
yield_point();
return true;
}
case 2: // found i-th potential prime but rejected for RSA
{
yield_point();
return true;
}
case 3: switch(ith) // found for RSA...
{