-
Notifications
You must be signed in to change notification settings - Fork 95
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
MSVC C2059 error when no signature is enabled #412
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Bence Mali <[email protected]>
@@ -613,29 +613,47 @@ static int oqs_group_capability(OSSL_CALLBACK *cb, void *arg) | |||
OSSL_PARAM_END \ | |||
} | |||
|
|||
# if defined(OQS_ENABLE_SIG_dilithium_2) \ | |||
|| defined(OQS_ENABLE_SIG_dilithium_3) \ |
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 will not work as and when the code generator (generate.py
) runs again: That can extend and reduce this list arbitrarily and hard-coding it as per this proposal will break the build. I see what you try to achieve but I'm afraid it needs a new generator fragment (in https://github.com/open-quantum-safe/oqs-provider/tree/main/oqs-template/oqsprov/oqsprov_capabilities.c).
static const OSSL_PARAM oqs_param_sigalg_list[][12] = { | ||
///// OQS_TEMPLATE_FRAGMENT_SIGALG_NAMES_START | ||
# ifdef OQS_ENABLE_SIG_dilithium_2 | ||
# ifdef OQS_ENABLE_SIG_dilithium_2 |
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.
All of these indentations make sense, but also need to be within their respective code generator fragment to still exist after the code generator has run.
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 once more for a sensible improvement PR. Please revise taking the code generator into consideration (see explanations and links in separate comments).
Thanks, I overlooked the code generator. I will have a look and maybe update this PR. |
Let me know if you don't find the time to dive into |
If no signature algorithm is enabled at compile time, the oqs_param_sigalg_list is an empty array, and when compiled with MSVC, it can cause a C2059 error. This can be avoided, if the the array is not created when no signature algorithm is enabled.