open-quantum-safe / liboqs

C library for prototyping and experimenting with quantum-resistant cryptography
https://openquantumsafe.org/
Other
1.78k stars 436 forks source link

API header file for ml_kem and ml_dsa seems to contains the wrong function names #1767

Closed matteo-cristino closed 4 months ago

matteo-cristino commented 4 months ago

Trying to include your ml_kem and ml_dsa library in our code we got an error sayign the function contained in the api.h file were not defined. Lookin closer to the files:

It seems that the functions in api.h file have the wrong name

SWilson4 commented 4 months ago

Hi @matteo-cristino, thanks for the report. It sounds to me like you might be including a non-public header file. You should not be including the .h files contained in the ml_dsa and ml_kem folders directly. Instead, you can include <oqs/sig.h> or <oqs/kem.h>, or just <oqs/oqs.h> if you want access to the entire liboqs API. Please see this example for signature use.

Please let me know if that fixes the problem.

jaromil commented 4 months ago

Thanks for your prompt answer @SWilson4 ! Our situation is different, since we include only some liboqs (and pqclean) implementations as static libraries inside our software, which is an isolated VM for secure execution with zero dependencies. In this specific case @matteo-cristino solved it like this https://github.com/dyne/Zenroom/pull/850/commits/df2fa4352de6298cfe8c5693eeca6ab4b1f895bd

In conclusion: it is of course fine if you have different names in api.h for reasons inherent to liboqs design, we may solve it even without modifying your header and using extern directives in our own code, to ease future update.

You may close this issue; it is solved for us.