-
Notifications
You must be signed in to change notification settings - Fork 464
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
Expose callback API for replacing low-level cryptographic primitives #1832
Conversation
Can you help me understand why making the functions themselves visible is necessary for replacing them via callbacks? I understand that the set callbacks function would need to be visible, but not the functions themselves. |
They are not necessary, though I would say having them in the public header doesn't harm much, as they are not exposed from the library ABI.
I can split them into a separate header, say |
Fair, although then it could be confusing to someone that they're exposed one way (in the headers) but not another way (in the binary).
I think this would be my preference. |
@dstebila I split the header into |
Thanks @ueno, I think this makes sense. @praveksharma or @SWilson4, any thoughts? |
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.
Thanks for this contribution, @ueno! I have one minor (non-blocking) suggestion; everything else looks good.
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.
These changes look good to me, thank you @ueno!
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.
Sorry for being the joykill -- but am I the only one missing some documentation explaining this split (what is public, what is "private"? How/by whom to use which APIs? Sample code?)? I'm not sure everyone will just (want to) read CMakeLists.txt files to understand this (what I effectively see as an externally visible liboqs
API) change.
I agree the logic of the PR makes sense and could merge as-is. However, @dstebila @hartm fyi, this is another example where an agreed-upon answer to open-quantum-safe/tsc#2 would be good. If my understanding of |
I guess I viewed this as a "fixup" to #1603, moving things (the That said... taking a second look with an eye to documentation, I think the As an aside, this also slipped by when reviewing #1603---maybe we need a CI check to ensure that all API functions are included in the generated docs. |
1c2cdb3
to
27ae0ae
Compare
This makes the callback API to replace low-level cryptographic implementation public again after open-quantum-safe#1667. Signed-off-by: Daiki Ueno <[email protected]>
@baentsch Given that we haven't even had the final NIST standards provided yet, I'm not too worried about breaking APIs at this point. Your point, overall, is a very good one though. It's important for users to know whether or not APIs will be changed in the future. Typically projects indicate that they are likely to support APIs for a long time by issuing an LTS (Long Term Support) release. While APIs are obviously never completely set in stone, people expect that they won't have to constantly update if they use LTS code. Does all of this make sense? |
What's the connection between NIST providing algorithm standards and a library striving for API stability? Do you expect NIST to standardize APIs, @hartm? Can you please point to such intention? If so, the purpose of this project indeed remains "experimental" until NIST finalizes this. But then OQS should clearly state that its APIs shall not be considered reliable until the NIST standards are announced. I personally doubt NIST will mandate APIs, though, as that'd be a can of worms: Which languages would it support, say?
I can understand you don't worry as you don't contribute or use |
The vast majority of people with which I've spoken on PQC have said that they aren't planning on fully putting PQC into production until after the NIST standards are finalized. NIST is not going to standardize APIs, of course, but they could change (or recommend changes) to minor things in protocols. You are correct that OQS should state a policy on APIs for the sake of users.
Who is using OQS in production deployments? And would they be upset at API changes? Ultimately, as you allude, whether or not API changes go smoothly or not are mostly dependent on appropriate communication between maintainers/contributors and users. The decision belongs to the maintainers/OQS TSC (certainly not me, and not the people who use and don't contribute either). Some of these decisions can be complicated and involve weighing whether or not improving the project by improving the APIs is worth making life more difficult for a subset of the users. I do generally worry about API changes, but 1) imagine that there aren't a lot of production deployments where these API changes would cause major grief (happy to be corrected here--please let me know if I'm wrong) and 2) am confident that API changes are better the earlier they are in a project's lifecycle. As the project grows, it becomes harder and harder to make these kinds of changes. So if it's something that's needed, it's better to do now rather than later. I hope all of this makes sense! |
Apologies @ueno for your PR being caught up in this discussion. I'm trying to move it to TSC issues that have been left open for (too?) long. My ask to you only was to consider adding documentation for this public/internal API split -- and I'm grateful for the comment by @SWilson4 picking/following that up: We could surely also split this into a separate issue regarding API documentation in general: If that approach would be OK for you, @SWilson4 (?) let's merge this when CI turns green. |
That works for me. I was the one who created the external/internal API split with #1648, so I will bear the burden of documenting it. 🙂 I just created #1841 to track. @ueno has updated the Doxyfile to pick up the |
This makes the callback API to replace low-level cryptographic implementation public again after #1667.
The purpose of this PR is to replace the implementation of symmetric primitives such as SHA3 used in ML-KEM, through the public API. That was my intention in #1603 but I didn't realize that
<oqs/aes.h>
and co. are moved to internal-only and no longer installed. This patch would make the GnuTLS liboqs integration self-contained.