Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Windows ARM64 builds with assembly and Poly1305 enabled omit required Poly1305 symbols because both Visual Studio projects lack the HAVE_POLY1305 assembler definition, causing linker failures.
1 open issue
What changed in this PR
Adds algorithm guards to generated wolfCrypt assembly ports so builds that compile entire port directories can disable Poly1305 or AES without compiling their implementations.
Changes:
- Wraps AArch64 Poly1305 assembly and inline-C variants in
HAVE_POLY1305. - Wraps RISC-V AES assembly and inline-C variants in
!NO_AES.
| File | Description |
|---|---|
wolfcrypt/src/port/riscv64/riscv-64-aes-asm.S |
Guards standalone AES assembly with !NO_AES. |
wolfcrypt/src/port/riscv64/riscv-64-aes-asm_c.c |
Guards inline AES assembly with !NO_AES. |
wolfcrypt/src/port/arm/armv8-poly1305-asm.S |
Guards standalone Poly1305 assembly with HAVE_POLY1305. |
wolfcrypt/src/port/arm/armv8-poly1305-asm.asm |
Adds the Poly1305 guard using ARM assembler syntax. |
wolfcrypt/src/port/arm/armv8-poly1305-asm_c.c |
Guards inline Poly1305 assembly with HAVE_POLY1305. |
Review effort: Balanced
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Two generated assembly ports were missing their algorithm guard. Autotools leaves these files out when the algorithm is disabled, but a
user_settings.hor IDE build that compiles every file in the port directory did not.armv8-poly1305-asm_c.c,armv8-poly1305-asm.Sandarmv8-poly1305-asm.asmare now wrapped inHAVE_POLY1305. Without Poly1305 they failed to compile withunknown type name 'Poly1305'. The 32-bit Arm, Thumb-2 and AArch64 ChaCha files already had the guard.riscv-64-aes-asm.Sandriscv-64-aes-asm_c.care now wrapped in!NO_AES, soAES_set_key_RISCV64is no longer built with AES disabled. This matches the AArch64 and PPC64 AES files.Regenerated from wolfSSL/scripts PR #.
Testing
Not tested on hardware. Every generated file under
wolfcrypt/srcwas compiled on its own with its architecture selectors set and all algorithms disabled; each now compiles to an empty object. AArch64 cross builds with--enable-armasmand--enable-armasm=inline, with and without Poly1305/ChaCha, passtestwolfcryptunder qemu-aarch64. The RISC-V AES base, scalar-crypto and vector-crypto paths build the same functions as before with AES enabled.