-
Notifications
You must be signed in to change notification settings - Fork 549
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
Some EC_Group usage cleanups #4038
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6ce128f
to
abe0e42
Compare
a9e67b0
to
44d543e
Compare
f87e076
to
c648a60
Compare
reneme
approved these changes
May 24, 2024
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.
Looks good to me in general, modulo a few nits and suggestions.
Comment on lines
127
to
+134
/** | ||
* Create an EC domain from PEM encoding (as from PEM_encode), or | ||
* from an OID name (eg "secp256r1", or "1.2.840.10045.3.1.7") | ||
* @param pem_or_oid PEM-encoded data, or an OID | ||
|
||
* | ||
* @warning Support for PEM in this function is deprecated. Use | ||
* EC_Group_from_PEM | ||
* EC_Group::from_PEM or EC_Group::from_OID or EC_Group::from_name | ||
*/ | ||
explicit EC_Group(std::string_view pem_or_oid); | ||
BOTAN_DEPRECATED("Use EC_Group::from_{name,OID,PEM}") explicit EC_Group(std::string_view pem_or_oid); |
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.
Full ack on splitting this initialization functionality into several factory methods. Less magic!
This hides all symbols of CurveGFp and CurveGFp_Repr (which were already marked as BOTAN_UNSTABLE_API and intentionally undocumented) and makes them accessible only to a few specific friends. For EC_Point deprecate a number of functions only needed for internal use. Also add a couple of functions to simplify a future bridge between our current APIs and pcurves. In EC_Group likewise begin some cleanup and deprecation.
Unlike the existing (deprecated) constructor, this constructor requires an OID, does not accept a cofactor, limits the field to at most 521 bits, and performs basic validation of the arguments.
Co-authored-by: René Meusel <[email protected]>
8039917
to
af9b85f
Compare
af9b85f
to
fe2ff50
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This hides all symbols of CurveGFp and CurveGFp_Repr (which were already marked as BOTAN_UNSTABLE_API and intentionally undocumented) and makes them accessible only to a few specific friends.
For EC_Point deprecate a number of functions only needed for internal use. Also add a couple of functions to simplify a future bridge between our current APIs and pcurves.
In EC_Group likewise begin some cleanup and deprecation.