-
Notifications
You must be signed in to change notification settings - Fork 8
Hash Driver Design #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
embediver
reviewed
Aug 12, 2025
Collaborator
Author
|
The main intent is to have agreement on the driver model |
FerralCoder
reviewed
Aug 18, 2025
wmaroneAMD
reviewed
Aug 19, 2025
…entation - Fix trait bound error in DigestInit doctest by adding missing DigestOp implementation for MyContext - Add new baremetal mock platform implementation with SHA-2 digest support - Update workspace to include platform/impls/baremetal/mock crate - Add zerocopy dependency to hal/blocking for IntoBytes trait support - Apply code formatting improvements and add missing license headers - All pre-checkin validation tests now pass
- Add complete MockMacDevice implementation with HMAC-SHA-2 support - Implement MacInit, MacOp, and MacCtrlReset traits for all SHA-2 variants - Include deterministic mock MAC generation based on key hash and data length - Add comprehensive unit tests covering device creation, reset, and MAC operations - Export mac module from platform mock library - Support for HmacSha2_256, HmacSha2_384, and HmacSha2_512 algorithms The mock implementation provides a software-only stub for MAC operations that can be used for testing when hardware acceleration is not available.
This is to solve a dependency conflict with the hubris workspace.
Fix hardware recovery pattern.
Introduces a dual API structure for OpenPRoT HAL digest traits to support both simple baremetal use cases and server applications requiring persistent sessions. ## Changes Made ### New API Structure - **Scoped API** (`digest::scoped`): Original lifetime-constrained traits for backward compatibility and simple use cases - **Owned API** (`digest::owned`): New move-based resource management for servers and persistent sessions ### Core Improvements - **Move-based safety**: Prevents use-after-finalize through ownership transfer - **Resource recovery**: Controllers are always recovered via `finalize()` or `cancel()` - **Session persistence**: Contexts can be stored across function boundaries - **IPC compatibility**: No lifetime constraints prevent crossing IPC boundaries ### Implementation Updates - Updated `hal/blocking/src/digest.rs` with dual API structure - Enhanced mock implementation with both scoped and owned patterns - Added comprehensive tests demonstrating session storage patterns - Fixed clippy warnings (mixed attributes style)
…raits - Add FromBytes and Immutable zerocopy trait derives to Digest<N> - Implement safe conversion methods: into_array(), as_array(), as_bytes() - Add comprehensive rustdoc explaining integration benefits vs opaque types - Include comparison table showing concrete vs opaque type advantages - Add unit tests for conversion methods, size verification, and alignment - Fix minor clippy warnings in mock implementation Addresses integration analysis feedback by eliminating need for unsafe conversions when working with Digest outputs in server applications. The concrete Digest<N> type provides compile-time type safety and direct IPC integration without opaque type bridging.
…ument. - Ran cargo fmt.
0b5e80c to
034c1fe
Compare
- Implement core::fmt::Display for digest::ErrorKind enum - Provide user-friendly error messages for digest operation errors - Follow Rust conventions for error type Display formatting - Enable better digest error reporting and library integration Digest error messages are lowercase, human-readable descriptions suitable for user-facing digest operation error reporting while maintaining technical accuracy for cryptographic operations.
wmaroneAMD
approved these changes
Aug 22, 2025
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.
No description provided.