Skip to content

ASM generation fixes#10023

Open
SparkiDev wants to merge 1 commit intowolfSSL:masterfrom
SparkiDev:asm_gen_fixes_2
Open

ASM generation fixes#10023
SparkiDev wants to merge 1 commit intowolfSSL:masterfrom
SparkiDev:asm_gen_fixes_2

Conversation

@SparkiDev
Copy link
Contributor

Description

Many comment fixes, label renaming and non-functional changes.

Bug Fixes

x86_64 (aes_xts_asm.S/.asm)

  • Removed a spurious movl %edx, %eax that was clobbering a register, then
    fixed two comparisons to use %edx instead of the now-stale %eax. This was a
    functional bug in AES-XTS key-rounds selection.

x86_64 (fe_x25519_asm.S)

  • Changed xor %rbx, %rbx → xorq %rbx, %rbx (explicit 64-bit operand size
    suffix).

ARM32 (sp_arm32.c, sp_cortexm.c)

  • Fixed typo in assembly label names: sub_in_pkace → sub_in_place (both label
    definitions and branch targets). Affected 2048-bit and 3072-bit SP functions.
  • Fixed wrong source register in multiply/accumulate sequences: r11 → r7 and
    r3 → r4 (functional register-use bugs).

ARM32 ChaCha (armv8-32-chacha-asm.S/_c.c)

  • Fixed label typo: same_keyb_ytes → same_key_bytes
  • Fixed NEON instruction syntax: vrev32.i16 → vrev32.16 (invalid mnemonic →
    correct ARM NEON form, affects multiple sites)

ARM32 SHA3 (armv8-32-sha3-asm_c.c, .S)

  • Fixed symbol name typo: L_sha3_arm2_neon_rt / L_sha3_arm2_rt → L_sha3_arm32_neon_rt / L_sha3_arm32_rt

ARM32 AES (armv8-32-aes-asm_c.c, thumb2-aes-asm_c.c, .S variants)

  • Fixed #endif comment: WOLFSSL_ARMASM_AES_BLOCK_INLINE → !WOLFSSL_ARMASM_AES_BLOCK_INLINE (logic inversion was missing from the comment)

ARM64 ChaCha (armv8-chacha-asm_c.c/.S)

  • Fixed label typo: arm64loop_lt_8 → arm64_loop_lt_8

ARM32 ML-KEM (armv8-32-mlkem-asm.S/_c.c)

  • Fixed #endif comment typo: WOLFSLS_ARM_ARCH → WOLFSSL_ARM_ARCH (across many
    occurrences)

SHA-512 (sha512_asm.S)

  • Corrected off-by-one in comments: msg_sched done: 0-3 → 0-1, 2-5 → 2-3, etc.
    (only 2 entries scheduled per block, not 4)

Testing

Regression tested assembly code.

Many comment fixes, label renaming and non-functional changes.

  Bug Fixes

x86_64 (aes_xts_asm.S/.asm)

- Removed a spurious movl %edx, %eax that was clobbering a register,
then
fixed two comparisons to use %edx instead of the now-stale %eax. This
was a
functional bug in AES-XTS key-rounds selection.

x86_64 (fe_x25519_asm.S)

- Changed xor %rbx, %rbx → xorq %rbx, %rbx (explicit 64-bit operand
size
suffix).

ARM32 (sp_arm32.c, sp_cortexm.c)

- Fixed typo in assembly label names: sub_in_pkace → sub_in_place
(both label
definitions and branch targets). Affected 2048-bit and 3072-bit SP
functions.
- Fixed wrong source register in multiply/accumulate sequences: r11 →
r7 and
r3 → r4 (functional register-use bugs).

ARM32 ChaCha (armv8-32-chacha-asm.S/_c.c)

- Fixed label typo: same_keyb_ytes → same_key_bytes
- Fixed NEON instruction syntax: vrev32.i16 → vrev32.16 (invalid
mnemonic →
correct ARM NEON form, affects multiple sites)

ARM32 SHA3 (armv8-32-sha3-asm_c.c, .S)

- Fixed symbol name typo: L_sha3_arm2_neon_rt / L_sha3_arm2_rt →
L_sha3_arm32_neon_rt / L_sha3_arm32_rt

ARM32 AES (armv8-32-aes-asm_c.c, thumb2-aes-asm_c.c, .S variants)

- Fixed #endif comment: WOLFSSL_ARMASM_AES_BLOCK_INLINE →
  !WOLFSSL_ARMASM_AES_BLOCK_INLINE (logic inversion was missing from the
comment)

ARM64 ChaCha (armv8-chacha-asm_c.c/.S)

- Fixed label typo: arm64loop_lt_8 → arm64_loop_lt_8

ARM32 ML-KEM (armv8-32-mlkem-asm.S/_c.c)

- Fixed #endif comment typo: WOLFSLS_ARM_ARCH → WOLFSSL_ARM_ARCH
(across many
  occurrences)

SHA-512 (sha512_asm.S)

- Corrected off-by-one in comments: msg_sched done: 0-3 → 0-1, 2-5 →
2-3, etc.
   (only 2 entries scheduled per block, not 4)
@SparkiDev SparkiDev self-assigned this Mar 20, 2026
@SparkiDev
Copy link
Contributor Author

Code generated from PR:
https://github.com/wolfSSL/scripts/pull/561

@SparkiDev
Copy link
Contributor Author

retest this please

@SparkiDev SparkiDev assigned wolfSSL-Bot and unassigned SparkiDev Mar 20, 2026
@SparkiDev SparkiDev requested a review from wolfSSL-Bot March 20, 2026 04:50
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