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

randombytes.c dependency on shared libraries #45

Open
RafKarr opened this issue Nov 29, 2021 · 3 comments
Open

randombytes.c dependency on shared libraries #45

RafKarr opened this issue Nov 29, 2021 · 3 comments

Comments

@RafKarr
Copy link

RafKarr commented Nov 29, 2021

Hello
When compiling Kyber as shared libraries, I believe that you are missing the randombytes.c file in the Makefile. I tried using the shared library in a Python script and it states "OS Error: randombytes symbol not found". I fixed it, by adding said file to the compilation command and now it works perfectly.

Environment:
Ubuntu 20.04
GCC 9.3.0
Python 3.8

Reproductible action:
Compiling shared libraries with "make shared" and then calling the libraries from Python

Expected result:
Libraries loaded and functions working

Actual result:
Library not loaded and error message "OS Error: randombytes symbol not found"

Cheers !

@Adrian-Grana
Copy link

Yes randombytes.c is missing, after adding it I could suddenly link everything just fine, will this issue be fixed? After adding the randombytes.c dependency the shared objects seem to work fine but standard "make" will then fail due to multiple names being the same...

@realityworks
Copy link

@Adrian-Grana is this going to be an issue still? I am looking at running this library via Swift.

@Adrian-Grana
Copy link

@realityworks Sorry for the late reply, yes it is but I think it's intentional because randombytes.c is the entropy source and depending on the project, other people may not want urandom from Linux, so this way you can choose the source of entropy yourself and link it with the rest of the project allong with the Kyber libraries.

What these PQC libraries need is a documentation, guess work should never be a part of implementing a crypto library.... So if you're doing anything that should be safe, either contact someone from the Crystals Team or wait for the standard from NIST.

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