Skip to content

XMSS: Fix index copy for signing.#9978

Merged
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
SparkiDev:xmss_sign_idx_fix
Mar 16, 2026
Merged

XMSS: Fix index copy for signing.#9978
JacobBarthelmeh merged 1 commit intowolfSSL:masterfrom
SparkiDev:xmss_sign_idx_fix

Conversation

@SparkiDev
Copy link
Copy Markdown
Contributor

Description

The index is already big-endian encoded but it needs to be front padded with zeros instead of back end padded.

Fixes #9966

Testing

Standard XMSS build.

The index is already big-endian encoded but it needs to be front padded
with zeros instead of back end padded.
@JacobBarthelmeh JacobBarthelmeh requested a review from Copilot March 16, 2026 15:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes XMSS index padding for signing by right-aligning the big-endian index within the destination buffer (zero-padding the front), addressing #9966.

Changes:

  • Update wc_idx_copy() to zero-pad the left side and copy the index into the end of the destination buffer.
  • Adjust the function comment to reflect the new alignment behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread wolfcrypt/src/wc_xmss_impl.c
Comment thread wolfcrypt/src/wc_xmss_impl.c
@JacobBarthelmeh JacobBarthelmeh merged commit 7ad9c25 into wolfSSL:master Mar 16, 2026
621 of 624 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For This Release Release version 5.9.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Inconsistent Integer-to-Byte Encoding of idx_sig

4 participants