Skip to content

Conversation

benma
Copy link
Collaborator

@benma benma commented Oct 4, 2025

Builds on #1619

benma added 5 commits October 2, 2025 12:32
The default implementation is in terms of other HAL/UI functions. For
unit tests (e.g. in show_mnemonic.rs or bip85.rs), it is useful to be
able to skip over the implementation details, so the tests don't have
to mock selecting the right words in the quiz.
This also allows us to keep track of the number of secure chip
operations in all the scenarios.
The sanity check to see if the seed has changed does not need a
securechip operation, it can use the retained seed hash instead, same
as `unlock_bip39()`. This reduces the number of securechip operations
needed to do a password check, which reduces the risk of running into
the Optiga throttling security mechanism.
@benma benma force-pushed the unlock-reduce-sc-events branch from c2562be to 4fcc8cd Compare October 4, 2025 21:08
Every call to `keystore::unlock` is followed by `copy_seed()`. The latter
uses a secure chip operation. We can remove that by returning the seed
from unlock and re-using it.

This reduces the number of securechip operations by 1 when:

- when unlocking the device
- showing mnemonic on initialized device
- creating backu on initialized device

This is to reduce the risk of running into Optiga's throttling
security mechanism.
@benma benma force-pushed the unlock-reduce-sc-events branch from 4fcc8cd to 7cd4971 Compare October 4, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant