Skip to content

Add a function to check if context string is supported#2142

Merged
SWilson4 merged 1 commit into
open-quantum-safe:mainfrom
M-AlNoaimi:OQS_SIG_supports_ctx_str
May 28, 2025
Merged

Add a function to check if context string is supported#2142
SWilson4 merged 1 commit into
open-quantum-safe:mainfrom
M-AlNoaimi:OQS_SIG_supports_ctx_str

Conversation

@M-AlNoaimi

Copy link
Copy Markdown
Contributor

Hi, this PR introduces a new API function:

OQS_API bool OQS_SIG_supports_ctx_str(const char *alg_name);
  • This allows for projects like liboqs-python to be able to check whether a given siguature algorithm supports context strings or not, without relying on internal structures.

This was done because I noticed liboqs-python's CI kept failing, due to context string-related tests running on algorithms that don't support them, there was a work-around in the pytest but that became a bit convoluted (at least more than if liboqs itself had a feature like this).

I was able to have a C-side test to check API and struct consistency for all enabled signature algorithms, I can add this in to the PR if needed, I kept it back as I'm not totally sure if there needs to be a specific test-case for this.

./build/tests/test_sig Dilithium2
OQS_SIG_supports_ctx_str API test passed for all enabled algorithms.
Testing signature algorithms using liboqs version 0.13.1-dev
...
Sample computation for signature Dilithium2
verification passes as expected

Signed-off-by: M-AlNoaimi <26318936+M-AlNoaimi@users.noreply.github.com>
@dstebila dstebila requested a review from a team May 26, 2025 13:26
@dstebila

Copy link
Copy Markdown
Member

Thanks very much! I don't think the consistency test needs to be added, so the PR looks good as is to me.

@SWilson4 SWilson4 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the contribution.

@SWilson4 SWilson4 requested a review from a team May 26, 2025 15:43
@SWilson4

Copy link
Copy Markdown
Member

@open-quantum-safe/liboqs-committers This adds an API call, so please do glance at it. @vsoftco, this might be of interest to you in particular given open-quantum-safe/liboqs-python#111.

@SWilson4 SWilson4 requested a review from vsoftco May 26, 2025 15:45

@christianpaquin christianpaquin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SWilson4

Copy link
Copy Markdown
Member

Thanks for the contribution!

@SWilson4 SWilson4 merged commit 51bf0b6 into open-quantum-safe:main May 28, 2025
79 checks passed
@M-AlNoaimi M-AlNoaimi deleted the OQS_SIG_supports_ctx_str branch May 28, 2025 11:34
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.

6 participants