Repository navigation
Add ML-DSA signed, AES-256 encrypted image boot from QSPI and SD for Versal VMK180 - #999
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The fallback path erases the unconfirmed image before FIT/DTB validation completes, so a later validation failure can trigger a panic and prevent recovery on reset.
4 open issues
What changed in this PR
Adds ML-DSA-87 signed, AES-256 encrypted image boot for Versal VMK180 using fixed QSPI slots or SD A/B slots, extending wolfBoot’s RAM loading and boot-confirmation support.
Changes:
- Stages encrypted external-flash images in RAM for decryption and verification.
- Adds partition-specific confirmation and optional rollback of unconfirmed RAM-boot images.
- Updates Versal QSPI writes, stack sizing, device-tree metadata, documentation, tests, and CI builds.
| File | Description |
|---|---|
tools/unit-tests/unit-versal-qspi-dma.c |
Tests single-device and striped QSPI write chunks. |
tools/unit-tests/unit-update-ram.c |
Tests slot reporting, confirmation, and rollback. |
tools/unit-tests/unit-update-ram-enc.c |
Tests short reads and unaligned encrypted payloads. |
tools/unit-tests/unit-update-flash.c |
Supplies an encryption-cache test buffer. |
tools/unit-tests/Makefile |
Adds test variants and QSPI write instrumentation. |
src/update_ram.c |
Tracks the boot slot and integrates staging and rollback cleanup. |
src/update_flash_hwswap.c |
Rejects the RAM-only rollback option. |
src/libwolfboot.c |
Implements slot confirmation, deferred erase, and ciphertext staging. |
options.mk |
Exposes rollback and encryption-cache settings. |
include/wolfboot/wolfboot.h |
Declares confirmation and rollback APIs. |
include/image.h |
Selects raw flash access for RAM decryption. |
include/fdt.h |
Declares the RAM boot-slot accessor. |
hal/versal.ld |
Enlarges the EL2 stack for ML-DSA verification. |
hal/versal.c |
Adjusts striped writes and adds key hooks and slot metadata. |
docs/Targets.md |
Documents encrypted Versal builds and platform key provisioning. |
docs/compile.md |
Explains optional unconfirmed-image rollback. |
docs/API.md |
Documents slot confirmation and encrypted-image version queries. |
.gitignore |
Ignores new test executables. |
.github/workflows/test-configs.yml |
Adds encrypted ML-DSA QSPI and SD build jobs. |
Review effort: Balanced
dgarske
force-pushed
the
versal_pq_enc
branch
from
November 23, 2026 23:08
939dd57 to
b0324c9
Compare
dgarske
force-pushed
the
versal_pq_enc
branch
from
November 24, 2026 23:58
b0324c9 to
0fd0df6
Compare
mattia-moffa
approved these changes
Nov 27, 2026
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.


Adds ML-DSA-87 signed, AES-256 encrypted image boot for the AMD Versal VMK180 from QSPI (two fixed slots) and SD (A/B slots).
wolfBoot_ram_decrypt()stages ciphertext from external flash that is not memory mappedwolfBoot_success_part()to confirm an image booted from the update partitionwolfBoot_update_trigger_part()to arm an update written to either fixed slotDUALBOOT_ROLLBACK_UNCONFIRMED=1for the RAM loaderwolfboot,boot-partpropertyTested on a VMK180: update, tampered image rejected, unconfirmed image rolled back. The platform supplies the encryption key; no key ships in wolfBoot.