CompactSeedQR format - #138
Merged
Merged
Conversation
Also misc cleanup, simplifications (f-strings in `settings_tools_view.py`.
Collaborator
|
@kdmukai can you add "compact_seedqr_enabled = False" to the settings var in tests/test_controller.py When I ran the test suite it failed because it was expecting compact_seedqr_enabled when performing configparser in the settings class. |
Contributor
Author
|
@newtonick ah, dang. I must have made my test suite changes before that Settings change happened. Good catch! This opened a bit of a can of worms on the testing side that prompted some good improvements.
|
kdmukai
marked this pull request as ready for review
January 23, 2022 16:27
Collaborator
|
LGTM. Great work here! |
Owner
|
Appreciate this Keith and thank you for the review Nick! |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new
CompactSeedQRformat which encodes the QR data as bytes in order to fit into a smaller QR code size.A 24-word seed is encoded as its 256-bit entropy into a 25x25 QR code.
A 12-word seed is encoded as its 128-bit entropy into a 21x21 QR code.
A mnemonic's checksum word is uniquely determined by the full entropy and so it is trivially calculated from this data in order to rebuild the full seed (in other words: it's implicit already in the data and so doesn't need to be stored explicitly).
CHANGES:
zbar0.23 or higherpyzbarqrcodefor more advanced rendering options (CircleModuleDrawer)CompactSeedQRformat for 12- or 24-word seeds while maintaining full reverse-compatibility with the "Standard" SeedQR format.settings.inifield before trying to read it inSettings.__config_to_databut a better overall approach to setting and storing config is probably in order.Misc:
Singletonclasses as needed in the test suite.Controllercan now be instantiated withdisable_hardwareso that the test suite can keep re-instantiating theControllerwithout creating gpio conflicts on the hardware itself.TODO:
zbar?pyzbar/zbarare fine scanning everything withbinary=True.