test(core): change `key_index` used in `crypto.tropic::test_sign` unittest
What changed, and why it matters
This commit only changes a test file for the Tropic cryptographic module. It swaps the hardcoded key index from 0 to 31 in a unit test. There is no change to production firmware code, no security fix, and no vulnerability being introduced or patched.
No security action needed. Treat as routine test maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies core/tests/test_trezor.crypto.tropic.py, replacing the literal key index 0 with a local variable key_index = 31 in the test_sign unit test. The test exercises tropic.sign and tropic.key_generate with a non-existent key, expects a TropicError, then generates the key and verifies a 64-byte signature. This is purely a test-code adjustment.
Changed components
core/tests/test_trezor.crypto.tropic.pyInspect captured patch +4 / −3
diff --git a/core/tests/test_trezor.crypto.tropic.py b/core/tests/test_trezor.crypto.tropic.py
index ff96875d..0caa6399 100644
--- a/core/tests/test_trezor.crypto.tropic.py
+++ b/core/tests/test_trezor.crypto.tropic.py
@@ -12,17 +12,18 @@ class TestCryptoTropic(unittest.TestCase):
self.assertEqual(tropic.ping("HeLlO!"), "HeLlO!")
def test_sign(self):
+ key_index = 31
try:
- tropic.sign(0, "ASD")
+ tropic.sign(key_index, "ASD")
assert False
except tropic.TropicError as e:
# key is not generated yet
self.assertIn("lt_ecc_eddsa_sign failed", str(e).lower())
- tropic.key_generate(0)
+ tropic.key_generate(key_index)
# signing should work now that we have a key
- self.assertEqual(len(tropic.sign(0, "a" * 32)), 64)
+ self.assertEqual(len(tropic.sign(key_index, "a" * 32)), 64)
if __name__ == "__main__":
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.