Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Assume global state for the board API #156

Closed
ia0 opened this issue May 12, 2023 · 0 comments · Fixed by #174
Closed

Assume global state for the board API #156

ia0 opened this issue May 12, 2023 · 0 comments · Fixed by #174
Assignees
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

Comments

@ia0
Copy link
Member

ia0 commented May 12, 2023

Issues with the current design:

  • There is some lifetime management involved. In particular, the Types trait is needed to work around that.
  • Some APIs don't need a global state, but they still take &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.

@ia0 ia0 added needs:design Needs design to make progress crate:board Modifies the board API for:usability Improves users (and maintainers) life for:maintainability Improves maintainers life labels May 12, 2023
ia0 added a commit to ia0/wasefire that referenced this issue May 12, 2023
@ia0 ia0 self-assigned this May 15, 2023
ia0 added a commit to ia0/wasefire that referenced this issue Jun 14, 2023
ia0 added a commit to ia0/wasefire that referenced this issue Jun 14, 2023
@ia0 ia0 closed this as completed in #174 Jun 14, 2023
ia0 added a commit that referenced this issue Jun 14, 2023
kofls pushed a commit to kofls/wasefire that referenced this issue Nov 27, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant