trussed-dev / trussed

Modern Cryptographic Firmware
https://trussed.dev
Apache License 2.0
405 stars 26 forks source link

key deletion: delete first the faster volatile storage and test publicc keys first #168

Closed sosthene-nitrokey closed 1 month ago

sosthene-nitrokey commented 1 month ago

Most key deletions are for volatile public keys (temporary keys for FIDO pin protocol, PIN keys from trussed-auth etc...). In any cases, persistent keys are more rarely deleted, and volatile is the fastest storage, so it being first is overall a performance improvement.

I think long term (once we have the builder-pattern based syscall implementation maybe?) we should add optional location and secrecy arguments to the syscall. It is rare that the caller would not know the kind of key it is deleting.

Current order is:

This PR makes it:

sosthene-nitrokey commented 1 month ago

Yeah, and apps using internal storage are also probably more time-sensitive. I'll change the order.