Skip to content

Conversation

@czurnieden
Copy link
Contributor

Instead of just adding some documentation regarding issue #521 I decided to fix that bug.

  • changed definition of 0 (zero) from not-a-square to is-a-square.
  • test added to check 0 (zero)
  • additional test added to check negative numbers

Does not seem to conflict with LibTomCrypt but that needs a proper check, I just grep'd for is_square.

Changes API and hence might conflict with other software that uses LTM but on the other side: it was a bug that gets fixed with this patch.

@czurnieden czurnieden requested a review from sjaeckel December 13, 2021 22:34
@sjaeckel
Copy link
Member

Changes API and hence might conflict with other software that uses LTM but on the other side: it was a bug that gets fixed with this patch.

How does this change the API? FMU it only fixes the bug.

Does not seem to conflict with LibTomCrypt but that needs a proper check

LTC doesn't even have a direct mapping of mp_is_square() into the MPI provider, so it doesn't matter.

The single LTM-internal consumer is mp_prime_is_prime() and there the behavior doesn't change since 0 is even and therefor we return before mp_is_square() would even be called.

@sjaeckel sjaeckel merged commit bea9270 into libtom:develop Dec 14, 2021
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.

2 participants