mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
ircd::openssl: Add yield points to genprime routine.
This commit is contained in:
parent
1bd130bf94
commit
89fbab2d7a
1 changed files with 12 additions and 0 deletions
|
@ -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...
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue