Skip to content

port/cavium: fix Octeon AES-GCM AAD GHASH bug#10439

Open
ejohnstown wants to merge 1 commit intowolfSSL:masterfrom
ejohnstown:octeon-fix
Open

port/cavium: fix Octeon AES-GCM AAD GHASH bug#10439
ejohnstown wants to merge 1 commit intowolfSSL:masterfrom
ejohnstown:octeon-fix

Conversation

@ejohnstown
Copy link
Copy Markdown
Contributor

Description

Octeon_AesGcm_SetAAD unconditionally ran XOR0/XORMUL1 on the partial-block buffer after the main loop, which processed an extra all-zero block when aadSz was a non-zero multiple of 16, corrupting the GCM tag. Guard the trailing XOR/MUL with if (remainder > 0).

Issue: F-3335

Testing

Visual inspection.

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

Octeon_AesGcm_SetAAD unconditionally ran XOR0/XORMUL1 on the partial-block
buffer after the main loop, which processed an extra all-zero block when
aadSz was a non-zero multiple of 16, corrupting the GCM tag. Guard the
trailing XOR/MUL with `if (remainder > 0)`.

Issue: F-3335
Copilot AI review requested due to automatic review settings May 8, 2026 16:50
@ejohnstown ejohnstown self-assigned this May 8, 2026
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 an Octeon AES-GCM GHASH correctness issue in the Cavium sync port where AAD processing incorrectly incorporated an extra all-zero block when aadSz was a non-zero multiple of 16, corrupting the resulting authentication tag.

Changes:

  • Guard the trailing partial-block GHASH XOR/MUL step in Octeon_AesGcm_SetAAD() so it only runs when remainder > 0.

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

@ejohnstown ejohnstown requested a review from dgarske May 8, 2026 17:32
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

MemBrowse Memory Report

No memory changes detected for:

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