Skip to content

refactor(qruov): use liboqs common AES backend - #2642

Open
0rlych1kk4 wants to merge 2 commits into
open-quantum-safe:mainfrom
0rlych1kk4:fix/qruov-common-aes-backend
Open

0rlych1kk4 wants to merge 2 commits into
open-quantum-safe:mainfrom
0rlych1kk4:fix/qruov-common-aes-backend

Conversation

@0rlych1kk4

@0rlych1kk4 0rlych1kk4 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Consolidate QR-UOV's AES-128 CTR implementation with the existing liboqs common AES backend, removing the QR-UOV-specific AES-NI implementation while preserving the optimized AVX2 signature implementation.

This addresses #2636.

Changes

  • Replace QR-UOV's private AES-128 CTR implementation with:
    • OQS_AES128_CTR_inc_init
    • OQS_AES128_CTR_inc_stream_iv
    • OQS_AES128_free_schedule
  • Remove src/sig/qruov/qruov_qruov_avx2/x86aesni.c and x86aesni.h.
  • Update prim.c, prim.h, and namespace.h to use the common AES backend.
  • Update QR-UOV's CMake configuration to remove the private AES backend while retaining AVX2 compilation and dispatch.
  • Register qruov-common-aes.patch in scripts/copy_from_upstream/copy_from_upstream.yml to preserve the changes during upstream source regeneration.

Validation

macOS ARM64

  • Build and QR-UOV signature tests passed.
  • All 30 QR-UOV deterministic KATs matched the existing reference values.

Linux AMD64 (Docker, GCC 13.3.0)

  • Full build completed successfully with OQS_DIST_BUILD=ON and OQS_USE_OPENSSL=OFF.
  • Confirmed the QR-UOV AVX2 implementation was enabled, with AES, AVX2, and BMI2 CPU support.
  • tests/test_aes passed using the liboqs AES-NI backend.
  • tests/test_sig QRUOV-1q7L10-aes passed.
  • All 30 QR-UOV deterministic KATs matched the SHA-256 values in tests/KATs/sig/kats.json.

Upstream regeneration

  • Verified that the registered patch applies to the pinned QR-UOV upstream source.
  • Confirmed regenerated QR-UOV integration files match the modified liboqs sources.

Compatibility

  • Does this PR change the input/output behaviour of a cryptographic algorithm (i.e., does it change known answer test values)? No. All 30 QR-UOV KATs match the existing reference values.
  • Does this PR change the list of algorithms available, or otherwise change an API? No. No algorithms are added, removed, or renamed, and no public API changes are introduced.

Testing and CI

This is a backend consolidation rather than a new feature. It uses the existing liboqs AES correctness tests, signature tests, and deterministic KAT infrastructure. No additional CI workflow is introduced in this PR.

Generative AI disclosure

Generative AI assistance was used to draft and refine the PR documentation. The technical changes and validation results were reviewed and verified by the contributor.

Closes #2636.

Signed-off-by: 0rlych1kk4 <orlychikka@gmail.com>
Signed-off-by: 0rlych1kk4 <orlychikka@gmail.com>
@coveralls

coveralls commented Oct 22, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 81.033% (-0.002%) from 81.035% — 0rlych1kk4:fix/qruov-common-aes-backend into open-quantum-safe:main

@0rlych1kk4

Copy link
Copy Markdown
Contributor Author

Hi @baentsch the QR-UOV common AES consolidation is ready for review. All 73 CI checks are passing, including the upstream regeneration and DCO checks. I also verified that all 30 QR-UOV KATs match the existing reference hashes on AMD64.

When you have a chance, could you please take a look? Thanks.

This branch has not been deployed

No deployments
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.

QR-UOV: use liboqs common AES implementation

2 participants