Skip to content
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

Seeking slip39 tests #1096

Open
onvej-sl opened this issue May 31, 2024 · 7 comments
Open

Seeking slip39 tests #1096

onvej-sl opened this issue May 31, 2024 · 7 comments

Comments

@onvej-sl
Copy link

I'm trying to implement a recent revision of the SLIP-39 specification.

I would like to ask

  • whether you have tests covering slip39 mnemonic generation and recovery and
  • (if so) what the easiest way is to run them.
@aaroninks
Copy link
Contributor

Thanks for the question,
Do you want to implement this on the Keystone3 firmware?

@aaroninks
Copy link
Contributor

The test vector defined in the SLIP-39 file can be helpful. https://github.com/satoshilabs/slips/blob/master/slip-0039.md#test-vectors. We are also using it to test our implementation.

@onvej-sl
Copy link
Author

onvej-sl commented Jun 3, 2024

Do you want to implement this on the Keystone3 firmware?

Yes.

We are also using it to test our implementation.

Where can I find the tests? How do I run them?

@aaroninks
Copy link
Contributor

aaroninks commented Jun 3, 2024

Do you want to implement this on the Keystone3 firmware?

Yes.

We are also using it to test our implementation.

Where can I find the tests? How do I run them?

these test cases are included in another repo which is used internally for testing purpose. The repo is not public for now.

@fmunteanu
Copy link

@aaroninks I'm unable to import a Trezor backup, probably because latest SLIP-39 is not present into Keystone firmware. See #1506.

@8de2fdb0
Copy link
Contributor

@aaroninks I refactored the work from @onvej-sl on top of current master. Unfortunately I have the same issues with adding tests.

I see that there are test cases read via USB when the firmware runs on a real device, the simulator doesn't seem to have that ability. Any help with adding test cases would be appreciated.

The changes are fairly small and in theory it should be backward compatible.
There is the odd case where the iteration exponent masks the extendable backup flag, since the iteration exponent used to be 5 bit and is now 4 bit where the first bit became the extendable backup flag. It looks as the firmware sets it to 0, but if a share hat the exponent set to be big enough to make the first bit toggled to high it would look as if it is a slip39 secret that has extendable backups enabled and the decryption would get a truncated pbkdf2 count and the final seed would be wrong. But that is very unlikely.

@fmunteanu
Copy link

Are the devs looking into this? This is blocker for importing Trezor SLIP-39 seed phrases, I have a difficult time why this is not addressed quickly.

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

No branches or pull requests

4 participants