feat(fw): add InitBk3 firmware handler with masked key codec#372
Open
jaygmsft wants to merge 2 commits into
Open
feat(fw): add InitBk3 firmware handler with masked key codec#372jaygmsft wants to merge 2 commits into
jaygmsft wants to merge 2 commits into
Conversation
vsonims
reviewed
May 7, 2026
vsonims
reviewed
May 7, 2026
431438e to
8882e7c
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
88f83cb to
3b25628
Compare
Adds the firmware-side InitBk3 DDI handler that masks a 48-byte BK3 against the partition's 80-byte BK_BOOT using AES-CBC-256 + HMAC-SHA-384 (encrypt-then-MAC), producing an mcr-hsm-compatible 244-byte MaskedKey wire-format blob. New crate fw/core/crypto/masked-key/ hosts the wire format and encode logic. Public surface: - mask_cbc(pal, io, masking_key, plaintext, metadata, out) - MASKING_KEY_AES_CBC_256_HMAC_384_LEN The encoder uses zerocopy-derived #[repr(C)] header structs as the single layout-of-truth and writes the blob directly into a caller- supplied DMA buffer (zero-init precondition checked via plaintext staging. Also includes: - fw/core/ddi/mbor/types/src/masked_key.rs: DdiMaskedKeyMetadata - Integration smoke tests in ddi/lib/tests/integration/init_bk3_smoke.rs - Copyright/format fixes in unrelated touched crypto files Validated: - 4/4 init_bk3 smoke tests pass against emu - 10/10 emu smoke tests pass - fmt + copyright clean Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3b25628 to
822a07d
Compare
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.
Add the InitBk3 DDI command handler and supporting infrastructure for BK3 initialization and masked key operations.
New modules:
PAL changes:
DDI integration test results with --features emu (566 total):
32 passed, 534 failed, 0 skipped
DDI smoke test results with --features emu (9 total):
9 passed, 0 failed, 0 skipped