Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a test that executes GMP operations in the context of elliptic curve.
This work is motivated by a bug from a couple of months ago (see #16870), which showed this use-case is uncovered by tests in PHP. The bug was fixed quickly, and in #16896 a unit test already landed for finite field cryptography. The test for elliptic curve cryptography is more complicated (as seen in this PR), so this was decided to be done later: #16896 (comment)
This unit test is written based on code developed for https://github.com/famoser/elliptic, which has been tested extensively. However, the code is not ready to use for security-related applications, as it has not been hardened nor tested against possible side channels. Side channels could leak the secret values, and therefore compromise the security of the algorithms.