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

Make internal API available to (only) test programs #1667

Merged
merged 9 commits into from
Jan 22, 2024
Merged

Conversation

SWilson4
Copy link
Member

This PR serves three purposes:

  1. to separate and define the OQS "internal API"
  2. to make the internal API available to our test programs, and
  3. to ensure that the internal API is not made available to library users.

It does so by doing the following:

  • Move the NIST DRBG to the OQS internal API.
  • Build the OQS internal API code (AES, SHA2, SHA3, and the NIST DRBG) as a separate oqs-internal library, with visibility set to "default".
  • Don't install the internal API headers in the CMake include directory.
  • Remove the internal API .h files from oqs.h and .Doxyfile.
  • Add #include statements as necessary to address compilation failures due to the above.
  • Link test programs against both oqs and oqs-internal.

This will hopefully make testing easier and in particular will unblock PR #1560. I've added it to the 0.10.0 milestone for the latter reason.

Fixes #1648.

  • Does this PR change the input/output behaviour of a cryptographic algorithm (i.e., does it change known answer test values)? (If so, a version bump will be required from x.y.z to x.(y+1).0.)
  • Does this PR change the list of algorithms available -- either adding, removing, or renaming? Does this PR otherwise change an API? (If so, PRs in fully supported downstream projects dependent on these, i.e., oqs-provider and OQS-OpenSSH will also need to be ready for review and merge by the time this is merged.)

Yes, the API is changed, but it's not much. The NIST DRBG is no longer exposed in the public API. This means changes to two public API functions: OQS_randombytes_switch_algorithm will now error when passed the string "NIST-KAT" (with or without capitalization) and OQS_randombytes_nist_kat_init_256bit has been deleted.

@SWilson4 SWilson4 added this to the 0.10.0 milestone Jan 16, 2024
@SWilson4
Copy link
Member Author

I also should mention that I deleted the nistseedexpander PQClean shim, which is no longer needed since #1585.

@SWilson4 SWilson4 mentioned this pull request Jan 16, 2024
4 tasks
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 @SWilson4 for this PR: After a first review, it looks good to me -- and reduces the "OQS support interface width" as (I think is) desirable. Allow me a bit more time to "test-drive" this branch in an oqs-provider setup. If you feel there's other sub-projects that may benefit from such test, be my guest :)

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.

Tested to work fine downstream. Thanks again for the reduction in potential support effort!

@SWilson4 SWilson4 merged commit cc453db into main Jan 22, 2024
56 checks passed
@SWilson4 SWilson4 deleted the sw-internal-api branch January 22, 2024 14:03
ueno added a commit to ueno/liboqs that referenced this pull request Jul 8, 2024
This restores the now-private headers as public again after open-quantum-safe#1667,
exposing the API to select alternative implementation through
callbacks, e.g., OQS_AES_set_callbacks.  Note the other functions in
those headers are still not exposed as they are declared without
OQS_API.

Signed-off-by: Daiki Ueno <[email protected]>
ueno added a commit to ueno/liboqs that referenced this pull request Jul 9, 2024
This makes the callback API to replace low-level cryptographic
implementation public again after open-quantum-safe#1667.

Signed-off-by: Daiki Ueno <[email protected]>
ueno added a commit to ueno/liboqs that referenced this pull request Jul 9, 2024
This makes the callback API to replace low-level cryptographic
implementation public again after open-quantum-safe#1667.

Signed-off-by: Daiki Ueno <[email protected]>
ueno added a commit to ueno/liboqs that referenced this pull request Jul 10, 2024
This makes the callback API to replace low-level cryptographic
implementation public again after open-quantum-safe#1667.

Signed-off-by: Daiki Ueno <[email protected]>
ueno added a commit to ueno/liboqs that referenced this pull request Jul 10, 2024
This makes the callback API to replace low-level cryptographic
implementation public again after open-quantum-safe#1667.

Signed-off-by: Daiki Ueno <[email protected]>
ueno added a commit to ueno/liboqs that referenced this pull request Jul 10, 2024
This makes the callback API to replace low-level cryptographic
implementation public again after open-quantum-safe#1667.

Signed-off-by: Daiki Ueno <[email protected]>
ueno added a commit to ueno/liboqs that referenced this pull request Jul 10, 2024
This makes the callback API to replace low-level cryptographic
implementation public again after open-quantum-safe#1667.

Signed-off-by: Daiki Ueno <[email protected]>
SWilson4 pushed a commit that referenced this pull request Jul 11, 2024
…1832)

This makes the callback API to replace low-level cryptographic
implementation public again after #1667.

Signed-off-by: Daiki Ueno <[email protected]>
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.

Better separate internal and public APIs
3 participants