-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bugs in mpint/tommath_ext_features #116
Conversation
LGTM |
add prime test times to pass the unittest
I request new reviews. change MPINT_ENFORCE_OK(mp_mod_d(&q, small_prime_prod, &mod)); Second, I can not explain why adding mp_prime_is_prime(p, 1, &res) helps pass the unittest steadily. But we need this to pass the unittest. I have tested some values of t of mp_prime_is_prime. It seems that a big t can not guarantee the generated p is a prime. But a small t can. I believe this is due to the inner structure of libtommath. But I don’t want to read all details of libtommath. I have tried to move MPINT_ENFORCE_OK(mp_prime_is_prime(p, 1, &res)); to the place above MPINT_ENFORCE_OK(mp_prime_is_prime(p, t, &res)); But this does not work. I guess it may be due to the random source of libtommath. Also note that pocklington criterion is deterministic: If q is prime and p passes pocklington criterion, then p must be prime. So we only need to do Lucas, Rabin, etc prime tests on q. |
decrease the test times
The failure of channel_brpc_blackbox_test in the unittest should not be a consequence of this pull request. |
I have restarted the unittest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job
What problem does this PR solve?
Issue Number: Fixed #107
Possible side effects?
Performance: Improve Performance
Backward compatibility: No side effects
Security: Secure