Skip to content

Fix build with NOSSE2 - #1891

Merged
idrassi merged 3 commits into
veracrypt:masterfrom
puleglot:nosse2
Oct 11, 2026
Merged

idrassi merged 3 commits into
veracrypt:masterfrom
puleglot:nosse2

Conversation

@puleglot

Copy link
Copy Markdown
Contributor

Disable AESNI and SHANI code that depends on SSE2 availability if NOSSE2 is enabled.

Disable AESNI and SHANI code that depends on SSE2 availability if NOSSE2
is enabled.

@idrassi idrassi 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.

Thanks for picking this up. The unmodified patch's 32 bit crypto libraries passed EncryptionTest::TestAll on my machine and under QEMU Pentium III model with SSE2 unavailable. There's useful progress here, but I found some issues that need addressing before merging:

  1. The amd64 build still fails: Disabling SHA removes the indirect wchar_t declaration from <immintrin.h>. Camellia.c then fails when including Common/Crypto.h. Adding <stddef.h> before that include fixes the build; the algorithm tests passed.

  2. Please keep runtime AES acceleration: -mno-sse2 already disables AES intrinsics. Aes_hw_cpu.asm is built separately, so CRYPTOPP_DISABLE_AESNI unnecessarily disables AES acceleration and the userspace Camellia fast path. Removing it passed the tests after the header fix. Please also keep object selection and callers consistent for NOSSE2=1 NOAESNI=1.

  3. The SHA guards don't agree: With GCC's -msha -mno-sse2, __SHA__ still enables the TrySHA256 call while CRYPTOPP_DISABLE_SHANI removes its implementation, causing a link failure. Please align the guards, preserving the NOASM and UEFI exclusions from #1896.

Keep AES/Camellia acceleration enabled and honor NOSSE2 with NOAESNI.
Include stddef.h outside UEFI to provide wchar_t for Camellia.
Match the SHA probe guard to its implementation, keeping NOASM and
UEFI exclusions.

@idrassi idrassi 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.

I have pushed a small followup addressing the points from my review:

  • Add the missing header for wchar_t in the amd64 build.
  • Preserve runtime AES/Camellia acceleration and handle NOSSE2=1 NOAESNI=1 consistently.
  • Align the SHA probe guards with its implementation, retaining the NOASM and UEFI exclusions.

Tested under QEMU Pentium III without SSE2.

Merging. Thank you for your contribution.

@idrassi
idrassi merged commit a835875 into veracrypt:master Oct 11, 2026
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