How to change entropy source? #2227
Replies: 1 comment 2 replies
-
The API in src/common/rand/rand.h lets you switch the RNG to your own custom algorithm: Line 46 in 01de36c |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello , i need to be able to source entropy from somewhere else. This is a hardware module and is located in /dev/ just like /dev/urandom.
After skimming through code and documentation, I realized that the only way to switch this behavior on is by configuring
OQS_EMBEDDED_BUILD=ON
at build time, which will signal the build process to ditch thegetrandom()
calls or/dev/urandom
accesses, as per limitations ofzephyr
(i gathered this notion from CONFIGURE.md)The following screenshot is from
rand.c
and it enforces this conceptSo my question is, where and when do i call
OQS_randombytes_custom_algorithm
to define another function, defined elsewhere, to provide entropy that is sourced from my/dev/something
? I do have a library available which was written specifically for this entropy module, and its headers are located at/usr/include
.I thought about just compiling liboqs but change
/dev/urandom
to/dev/something
in the following code block ofrand.c
which would effectively allow me to compile without having to trick the build process into thinking this is meant for an "embedded" system (the target is linux). Is this a good idea? Please, let me know. I'm convinced that it is NOT a good idea, but it might be the shortest path to do what I need to do.
Any help would be very appreciated thank you
Beta Was this translation helpful? Give feedback.
All reactions