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

MSVC C2059 error when no signature is enabled #412

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bencemali
Copy link
Contributor

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.

@@ -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) \
Copy link
Member

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
Copy link
Member

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.

Copy link
Member

@baentsch baentsch left a 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).

@bencemali
Copy link
Contributor Author

Thanks, I overlooked the code generator. I will have a look and maybe update this PR.

@baentsch
Copy link
Member

maybe update this PR.

Let me know if you don't find the time to dive into jinja2. I'd then add this on to this PR.

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

Successfully merging this pull request may close these issues.

2 participants