-
Notifications
You must be signed in to change notification settings - Fork 574
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
Conversation
6ce128f
to
abe0e42
Compare
a9e67b0
to
44d543e
Compare
f87e076
to
c648a60
Compare
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.
/** | ||
* 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
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.