Skip to content
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

Added checks for PRNG generated values #552

Merged
merged 1 commit into from
Jun 1, 2023

Conversation

czurnieden
Copy link
Contributor

As mentioned in #551 : randomly generated values for restricted input must be checked before use.

demo/test.c Outdated
Comment on lines 1576 to 1579
DO(mp_rand(&a, i));
if (mp_cmp_d(&a,2u) == MP_LT) {
continue;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it maybe make sense to do the following instead?

Suggested change
DO(mp_rand(&a, i));
if (mp_cmp_d(&a,2u) == MP_LT) {
continue;
}
do {
DO(mp_rand(&a, i));
} while (mp_cmp_d(&a,2u) == MP_LT);

demo/test.c Outdated
Comment on lines 1581 to 1584
DO(mp_rand(&base, j));
if (mp_cmp_d(&base,2u) == MP_LT) {
continue;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@czurnieden
Copy link
Contributor Author

Why are you always have to be right? ;-)

Rebase into single commit?

@sjaeckel
Copy link
Member

sjaeckel commented May 30, 2023

Rebase into single commit?

Yes please! Thanks

@sjaeckel sjaeckel merged commit 9f0b3f5 into libtom:develop Jun 1, 2023
@sjaeckel sjaeckel added this to the v2.0.0 milestone Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants