Skip to content
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

Suggestion: make the project header-only #1203

Closed
DevelopDaily opened this issue Apr 22, 2022 · 3 comments
Closed

Suggestion: make the project header-only #1203

DevelopDaily opened this issue Apr 22, 2022 · 3 comments

Comments

@DevelopDaily
Copy link

DevelopDaily commented Apr 22, 2022

Is there any particular reason to implement this project by separating the header files *.h and the implementation files *.c

I think this project is suitable for header-only implementation. It never intends to make the library link-only because its permissive MIT license encourages the user to reference the source code directly. Header-only projects would serve a wider community. For example, any WASM applications will automatically build because it is just a matter of a single #include <oqs.h> statement in the existing applications without any modification of the existing build process.

The renowned Boost C++ project is a credible header-only example. The Quantum++ in the quantum computing community is another good example.

@baentsch
Copy link
Member

Is there any particular reason to implement this project by separating the header files *.h and the implementation files *.c

Beyond this being standard practice for C libraries and a matter of good "separation of concerns", this allows liboqs to hide different implementations for various components behind the same headers (e.g., optimized code via assembly or openssl) such as to enable experimentation and optimization without exposing all details to the library users.

Regarding WASM, the following reiterates #1199 : A PR would be a good way to discuss how to bring all code into a header file if you see/know of a good use case. As I don't see liboqs abandoning the advantages brought by interface/implementation separation, this should come as a script creating such "WASM_ready_oqs.h" from the most current code base.

@DevelopDaily
Copy link
Author

... this should come as a script creating such "WASM_ready_oqs.h" from the most current code base.

That seems to be a brilliant idea, which could give us the best of both worlds.

Though I haven't been able to come up with a commercially compelling use case yet, I think I will keep this ticket open as a possible enhancement request.

I am still ignorant of the workflow in this area. Perhaps, some web-based file sharing applications, which do not need real time encryption/decryption at transport layer, may use liboqs to check the signatures at some point.

@dstebila
Copy link
Member

We discussed this in our weekly status meeting, and we think that the project itself should stay with the standard C paradigm of separating headers and implementations. We'd be willing to accept as PR a script that generates an appropriate header-only version as needed for specialized scenarios. But for now we'll close this issue.

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

No branches or pull requests

3 participants