Skip to content

Conversation

@czurnieden
Copy link
Contributor

@czurnieden czurnieden commented Sep 7, 2022

Changed a check for <0 with mp_isneg() in s_mp_invmod

Additional tests for mp_invmod() in demo/test.c

This fixes #534

demo/test.c Outdated
if (e != MP_OKAY) {
if (results[i+10][j+10] != -1) {
printf("error = %s from ", mp_error_to_string(e));
printf("error at i = %d, j =%d should be an error but gave %d\n",i,j, results[i+10][j+10]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this print out the value of c instead of the expected results table?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, of course it should!
Thanks!

Changed a check for <0 with mp_isneg() in s_mp_invmod

Additional tests for mp_invmod() in demo/test.c
@sjaeckel sjaeckel merged commit 03de03d into libtom:develop Oct 28, 2022
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

s_mp_invmod_odd returns wrong result for negative numbers

3 participants