Skip to content

Commit ead1ef6

Browse files
BitHighlanderclaude
andcommitted
feat(debuglink): add read_recovery_state() for combined cipher+layout reads
Single DebugLinkGetState call returns cipher, auto_completed_word, and layout — avoids 3 separate round-trips per character during zoo capture. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 1c1a549 commit ead1ef6

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎keepkeylib/debuglink.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,19 @@ def read_recovery_auto_completed_word(self):
9999
obj = self._call(proto.DebugLinkGetState())
100100
return obj.recovery_auto_completed_word
101101

102+
def read_recovery_state(self):
103+
"""Read cipher + auto-completed word + layout in a single call.
104+
105+
Returns dict with keys: cipher, auto_completed_word, layout
106+
Avoids 3 separate DebugLinkGetState round-trips per character.
107+
"""
108+
obj = self._call(proto.DebugLinkGetState())
109+
return {
110+
'cipher': obj.recovery_cipher,
111+
'auto_completed_word': obj.recovery_auto_completed_word,
112+
'layout': obj.layout,
113+
}
114+
102115
def read_memory_hashes(self):
103116
obj = self._call(proto.DebugLinkGetState())
104117
return (obj.firmware_hash, obj.storage_hash)

0 commit comments

Comments
 (0)