From 342174d93c32209fa7ea3e0553f214c5214a4d59 Mon Sep 17 00:00:00 2001 From: highlander Date: Tue, 4 Aug 2026 14:45:42 -0300 Subject: [PATCH] feat(reset): dice-entropy fields for on-device roll collection ResetDevice.dice_entropy=10 asks the device to collect dice rolls with the single button and mix them into the internal entropy before it is displayed or committed. DebugLinkDecision.input=2 lets debug builds inject synthetic roll input (kept short so the decoded struct fits the firmware tiny-message buffer). DebugLinkState.dice_digest=15 exposes SHA-256 of the collected ASCII roll string so tests can prove the device received exactly the injected rolls. ButtonRequest_DiceRoll=39 announces the entry screen to the host. --- messages.proto | 10 ++++++++++ types.proto | 1 + 2 files changed, 11 insertions(+) diff --git a/messages.proto b/messages.proto index 26e7290e..a35d67c6 100644 --- a/messages.proto +++ b/messages.proto @@ -576,6 +576,9 @@ message ResetDevice { 7; // Initialize without ever showing the recovery sentence. optional uint32 auto_lock_delay_ms = 8; // Screensaver Timeout optional uint32 u2f_counter = 9; // U2F Counter + optional bool dice_entropy = + 10; // collect dice rolls on the device and mix them into the internal + // entropy before it is displayed or committed } /** @@ -986,6 +989,10 @@ message FirmwareUpload { */ message DebugLinkDecision { required bool yes_no = 1; // true for "Confirm", false for "Cancel" + optional string input = + 2; // synthetic keyboard input for on-device entry flows (e.g. dice + // rolls '1'-'6', 'u' for undo); kept short so the decoded struct + // fits the tiny-message buffer } /** @@ -1020,6 +1027,9 @@ message DebugLinkState { 12; // last auto completed recovery word optional bytes firmware_hash = 13; // hash of the application and meta header optional bytes storage_hash = 14; // hash of storage + optional bytes dice_digest = + 15; // SHA-256 of the ASCII dice-roll string collected during a + // dice_entropy ResetDevice workflow } /** diff --git a/types.proto b/types.proto index 18cf8fab..9ceaf72c 100644 --- a/types.proto +++ b/types.proto @@ -134,6 +134,7 @@ enum ButtonRequestType { ButtonRequest_RemoveWipeCode = 36; ButtonRequest_ChangeWipeCode = 37; ButtonRequest_CreateWipeCode = 38; + ButtonRequest_DiceRoll = 39; } /**