-
Notifications
You must be signed in to change notification settings - Fork 493
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
Add support for Zephyr RTOS #1621
Conversation
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 the contribution and new platform! Please provide feedback to some single comments/questions to help me understand things better. According to the Zephyr documentation there should be a person maintaining this module. Can we safely assume you'll do this -- also giving us a person to point questions to coming towards liboqs
(related to this integration)? It would also be good to know that there is alignment on the platforms Zephyr and liboqs
support: Are/have you already ascertain(ed) that?
Yes, I am happy to maintain the port. I haven‘t completely looked into the supported platforms actually. What exactly are you looking for in that regard? |
Thanks!
Is there a 1:1 match regarding the platforms that Zephyr supports and the ones that |
Currently, the matching platforms are 32-bit ARM, 64-bit ARM, x86 and “native build” on Linux (which is then probably one of 32/64-bit ARM, x86, or x86_64). In the latest changes of the commits, I added a dependency from within Zephyr to only enable the module if one of these supported platforms is selected. Otherwise, the liboqs module is disabled and a warning is raised in Zephyr. To fully support all platforms of Zephyr in liboqs, we would have to add support for I think it doesn't make sense to add those platforms now until there is actual request (also, I don't have hardware to test liboqs on those platforms, actually). |
Fully agree.
Good addition. Resolves my concerns around platforms: Thanks! |
Hi @Frauschi, thanks for the PR. Is it absolutely necessary to introduce the |
This is indeed exactly the same issue I faced with Zephyr, as both the I see one big problem with the solution proposed in #1490, for which I added the If it is desired, I can of course revert the |
Well, two thoughts:
Also tagging @mabarger for input as to the propensity/time to contribute as per #1490 (comment) |
True, I reverted my
Added that, too. @baentsch @SWilson4 what do you think about the new RNG setup? |
@Frauschi I don't quite "feel" like reviewing this so late in my day -- but will do before Monday. Independent of that could you please rebase the PR to the latest "main" to ascertain that CI passes? |
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.
Conceptually looks good. Let's see what CI says. Besides some single comments that would be good to address, I am missing documentation for the new config variable. It may be good to explain differences to OQS_BUILD_ONLY_LIB and how it impacts OQS_DIST_BUILD.
I added documentation for the new option in
I didn't mention these two explicitly, as they are not really related to the new option. With the explanation of the new option, however, I think this should also be clear to a potential user of |
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.
This commit adds initial support for the zephyr operating system. Some minor changes to the library build system have been made for it to be compilable with zephyr. Furthermore, we added support for an embedded build option to disable standard library methods for random number generation. Signed-off-by: Tobias Frauenschläger <[email protected]>
The algorithms can now be selected with Kconfig. Per default, we only enable the algorithms selected by NIST to be standardized. However, all supported algorithms can be enabled or disabled individually on a per project basis. Signed-off-by: Tobias Frauenschläger <[email protected]>
Added two sample applications within the zephyr directory for KEMs and Signatures. These two are also intended for future CI testing. Signed-off-by: Tobias Frauenschläger <[email protected]>
Added a Github Action workflow to test the Zephry port in CI by running both the KEM and the Signature example within the zephyr directory. Signed-off-by: Tobias Frauenschläger <[email protected]>
Signed-off-by: Tobias Frauenschläger <[email protected]>
Thanks again for your contribution, @Frauschi ! Merged. |
Hi everybody,
This PR adds support for the Zephyr RTOS, so liboqs can be used as a module (see here).
The main changes to the existing library code are focussed on the CMake build environment to enable the library to be built with the Zephyr SDK. All changes should not influence existing builds outside the Zephyr environment. (However, some changes also improve the integration of liboqs directly in a CMake-based project without installing it system-wide.)
One bigger source code change is related to random number generation. Zephyr doesn't support any of the currently present RNG interfaces. To be most flexible, I added a generic
OQS_USE_EXTERNAL_RNG
option (disabled by default). In this case, an externally defined methodOQS_randombytes_external()
must be present during link time, which is then used to obtain random data. For Zephyr, I implemented that method to generate random data using their RNG interface.The main Zephyr integration is all contained in the new
zephyr
folder in the root directory (common practice for Zephyr modules to have this folder). In that directory, there is a customCMakeLists.txt
to integrate the existing CMake infrastructure into Zephyr. Furthermore, a Kconfig file is provided to configure the build (and especially the algorithm selection). Finally, the newOQS_randombytes_external
method is implemented in a small C source file here.As this is my first PR for this project, I'm not sure if the changes are upstreamable in the current form. But I'm looking forward to your feedback.
Kind regards,
Tobi