Skip to content

[Backport esp-hal-1.1.x] ESP32: RSA, SHA fixes#5607

Open
github-actions[bot] wants to merge 1 commit into
esp-hal-1.1.xfrom
backport-5592-to-esp-hal-1.1.x
Open

[Backport esp-hal-1.1.x] ESP32: RSA, SHA fixes#5607
github-actions[bot] wants to merge 1 commit into
esp-hal-1.1.xfrom
backport-5592-to-esp-hal-1.1.x

Conversation

@github-actions
Copy link
Copy Markdown

Description

Backport of #5592 to esp-hal-1.1.x.

@github-actions
Copy link
Copy Markdown
Author

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-5592-to-esp-hal-1.1.x
git worktree add --checkout .worktree/backport-5592-to-esp-hal-1.1.x backport-5592-to-esp-hal-1.1.x
cd .worktree/backport-5592-to-esp-hal-1.1.x
git reset --hard HEAD^
git cherry-pick -x 72d44d0721677f07b35bcdcb716943f56e7b66f6
git push --force-with-lease

@github-actions github-actions Bot mentioned this pull request May 26, 2026
@bugadani bugadani force-pushed the backport-5592-to-esp-hal-1.1.x branch from 7cd0868 to 913f0fd Compare May 27, 2026 09:54
@bugadani bugadani marked this pull request as ready for review May 27, 2026 09:54
Copilot AI review requested due to automatic review settings May 27, 2026 09:54
@bugadani
Copy link
Copy Markdown
Contributor

Hmm I'm not sure how the changelog system handles backports

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

Backport of upstream ESP32 crypto accelerator fixes to the esp-hal-1.1.x branch, addressing ESP32-specific SHA and RSA correctness issues around peripheral/interrupt handling and resource ownership.

Changes:

  • SHA (ESP32): introduce an explicit hardware/software hasher split so concurrent contexts fall back to software and the SHA peripheral isn’t powered down while a hardware context is active.
  • RSA (ESP32): unify peripheral lifetime management into a guard that disables RSA interrupts before the peripheral clock gets stopped.
  • HIL test: adjust SHA interleaving test to drop the Sha driver before starting the backend, allowing backend resource release.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
hil-test/src/bin/crypto/sha.rs Drops the Sha driver in the interleaved rolling-context test to ensure backend resources can be released/reacquired as intended.
esp-hal/src/sha.rs Adds ESP32-specific Esp32Hasher (hardware guard vs software fallback) and adjusts context drop behavior/flagging for accelerator usage.
esp-hal/src/rsa/mod.rs Replaces separate guards with a single RsaGuard to ensure interrupts are disabled before peripheral shutdown across chips (including ESP32).

Comment thread esp-hal/src/sha.rs
@MabezDev
Copy link
Copy Markdown
Member

Hmm I'm not sure how the changelog system handles backports

I guess we need to find out :D

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.

3 participants