rust/tests: remove unneeded random::fake_reset calls
What changed, and why it matters
This commit only removes unnecessary calls to a test helper named fake_reset() inside unit tests. It does not change any production code that runs on the actual BitBox02 device, so it cannot affect real users or introduce a security vulnerability.
No security action needed. Treat as a normal test-maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff deletes nine invocations of bitbox02::random::fake_reset() across two Rust test modules (signtx.rs and keystore.rs). These calls reset a fake random-number generator used only in test mocks. No production firmware logic, cryptographic operations, memory handling, or host-facing API code is modified. The change is a test-code cleanup with no security relevance.
Changed components
src/rust/bitbox02-rust/src/hww/api/bitcoin/signtx.rs (unit tests only)src/rust/bitbox02-rust/src/keystore.rs (unit tests only)Inspect captured patch +0 / −9
diff --git a/src/rust/bitbox02-rust/src/hww/api/bitcoin/signtx.rs b/src/rust/bitbox02-rust/src/hww/api/bitcoin/signtx.rs
index d284569..9340cb6 100644
--- a/src/rust/bitbox02-rust/src/hww/api/bitcoin/signtx.rs
+++ b/src/rust/bitbox02-rust/src/hww/api/bitcoin/signtx.rs
@@ -2232,7 +2232,6 @@ mod tests {
mock_host_responder(transaction.clone());
mock_unlocked();
- bitbox02::random::fake_reset();
let result = block_on(process(
&mut TestingHal::new(),
&transaction.borrow().init_request(),
@@ -3227,7 +3226,6 @@ mod tests {
"sudden tenant fault inject concert weather maid people chunk youth stumble grit",
"",
);
- bitbox02::random::fake_reset();
// For the policy registration below.
mock_memory();
@@ -3412,7 +3410,6 @@ mod tests {
"sudden tenant fault inject concert weather maid people chunk youth stumble grit",
"",
);
- bitbox02::random::fake_reset();
// For the policy registration below.
mock_memory();
@@ -3710,7 +3707,6 @@ mod tests {
mock_host_responder(transaction.clone());
mock_unlocked();
- bitbox02::random::fake_reset();
let init_request = transaction.borrow().init_request();
let mut mock_hal = TestingHal::new();
@@ -3789,7 +3785,6 @@ mod tests {
mock_host_responder(transaction.clone());
mock_unlocked();
- bitbox02::random::fake_reset();
let init_request = transaction.borrow().init_request();
let mut mock_hal = TestingHal::new();
@@ -3829,7 +3824,6 @@ mod tests {
mock_host_responder(transaction.clone());
mock_unlocked();
- bitbox02::random::fake_reset();
let init_request = transaction.borrow().init_request();
let mut mock_hal = TestingHal::new();
@@ -3861,7 +3855,6 @@ mod tests {
mock_host_responder(transaction.clone());
mock_unlocked();
- bitbox02::random::fake_reset();
let init_request = transaction.borrow().init_request();
let mut mock_hal = TestingHal::new();
diff --git a/src/rust/bitbox02-rust/src/keystore.rs b/src/rust/bitbox02-rust/src/keystore.rs
index 2b68e55..c717588 100644
--- a/src/rust/bitbox02-rust/src/keystore.rs
+++ b/src/rust/bitbox02-rust/src/keystore.rs
@@ -1283,7 +1283,6 @@ mod tests {
};
// Test without tweak
- bitbox02::random::fake_reset();
bitbox02::securechip::fake_event_counter_reset();
let sig = secp256k1_schnorr_sign(&keypath, &msg, None).unwrap();
@@ -1300,7 +1299,6 @@ mod tests {
);
// Test with tweak
- bitbox02::random::fake_reset();
let tweak = secp256k1::Scalar::from_be_bytes(hex!(
"a39fb163dbd9b5e0840af3cc1ee41d5b31245c5dd8d6bdc3d026d09b8964997c"
))
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.