test(python): use `nist256p1` in payment device tests [no changelog]
What changed, and why it matters
This commit only changes a test file used during automated testing. It swaps the cryptographic curve and private key used to generate fake payment-request signatures in tests, from Bitcoin's secp256k1 curve to the NIST P-256 curve. There is no change to the actual Trezor firmware or to how real payment requests are validated. It is a testing-only adjustment with no security relevance to end users.
No action required. This is a test-only change and does not affect production firmware or user security.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In tests/device_tests/payment_req.py, the test harness imports NIST256p instead of SECP256k1 from the ecdsa library and replaces the hard-coded test signing key with a 32-byte key suitable for P-256. The payment_req_signer object is used to produce test signatures for device payment-request tests. The diff is limited to test code and does not alter firmware logic, message parsing, signature verification, or any runtime behavior of the device.
Changed components
tests/device_tests/payment_req.pyInspect captured patch +3 / −3
diff --git a/tests/device_tests/payment_req.py b/tests/device_tests/payment_req.py
index 9ac50c5a7..d6787197b 100644
--- a/tests/device_tests/payment_req.py
+++ b/tests/device_tests/payment_req.py
@@ -1,7 +1,7 @@
from dataclasses import dataclass
from hashlib import sha256
-from ecdsa import SECP256k1, SigningKey
+from ecdsa import NIST256p, SigningKey
from trezorlib import messages
from trezorlib.transport.session import Session
@@ -36,8 +36,8 @@ class CoinPurchaseMemo:
payment_req_signer = SigningKey.from_string(
- b"?S\ti\x8b\xc5o{,\xab\x03\x194\xea\xa8[_:\xeb\xdf\xce\xef\xe50\xf17D\x98`\xb9dj",
- curve=SECP256k1,
+ b"\x05\x62\x35\xb0\x47\x6f\x05\x7f\x27\x65\x21\x97\x24\xf7\xf1\x80\x7d\x58\x80\x2b\x55\x0e\xd5\xbf\x6f\x73\x05\x0a\xf5\x45\x63\x00",
+ curve=NIST256p,
)
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.