Assume global state for the board API #156
Labels
crate:board
Modifies the board API
for:maintainability
Improves maintainers life
for:usability
Improves users (and maintainers) life
needs:design
Needs design to make progress
Issues with the current design:
Types
trait is needed to work around that.&mut self
. For example SHA-256 and HMAC-SHA-256 just have their own context and don't need a global state. In particular, it is not possible to provide a state-less implementation (e.g. of RustCrypto traits) on top of the board API, which is needed when software implementation must be "chained" (e.g. software HMAC-SHA-256 on top of hardware SHA-256).The proposal is to put the burden of handling global state (when needed) to the board implementer. Maybe helpers could be provided. We should also then be able to reuse existing state-less APIs like RustCrypto.
A possible alternative would be to decide when the board API should have a global state. But this is assuming something on all implementations, and those that needs a state when the API is state-less would still need to handle their global state like for the other proposal above. So a more uniform approach is preferred.
The text was updated successfully, but these errors were encountered: