Commit Graph

292 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
9a1db36602 Address code review: simplify ctypes buffer conversions in test_curves.py
Co-authored-by: obrusvit <14001709+obrusvit@users.noreply.github.com>
2026-02-18 15:30:20 +00:00
copilot-swe-agent[bot]
10ce71c6f6 Clean up: remove unused imports from test_curves.py and blank line from pyproject.toml
Co-authored-by: obrusvit <14001709+obrusvit@users.noreply.github.com>
2026-02-18 15:28:33 +00:00
copilot-swe-agent[bot]
cd658feae2 Replace ecdsa with cryptography in tests/bip32.py and crypto/tests/test_curves.py
Co-authored-by: obrusvit <14001709+obrusvit@users.noreply.github.com>
2026-02-18 15:24:08 +00:00
Andrew Kozlik
477cbb365a fix(crypto): Clean up stack in hdnode_deserialize(). 2026-02-16 17:44:01 +01:00
M1nd3r
13e6c4f55d fix(crypto): fix cash_encode
- Fixed description of buffer sizes in the header file.
- Added check of hrp length in cash_encode. Otherwise it allows to encode addresses that cannot be decoded using cash_decode.
- Adjusted naming of constants and parameters for clarity and consistency.

[no changelog]
2026-01-28 17:32:36 +01:00
Martin Pastyřík
9b1c06205c fix(crypto): Fix side-channel vulnerability in BIP-39 mnemonic processing
Fix function `mnemonic_to_bits` to be constant time. Replace binary search over the wordlist with a linear search to ensure the same number of comparisons.
Introduce function `constant_time_memeq` that comapres two parts of memory in costant time.
Remove integrity check in legacy to reduce the number of computations over seed.

(cherry picked from commit 4e6f0dee81)
2026-01-26 14:50:50 +01:00
M1nd3r
6681384b44 feat(crypto): extend DER functionality in trezor-crypto
- added `der_equal` and `der_read_item_expected`
- added (defined) DER_OID tag
- added const qualifiers to BUFFER_READER read-only functions

[no changelog]
2026-01-16 15:11:30 +01:00
Andrew Kozlik
ea542943fc fix(legacy): Improve handling of value overflows.
[no changelog]
2025-12-05 16:54:24 +01:00
Martin Milata
7796e04165 refactor(crypto): add missing header
[no changelog]
2025-11-18 19:55:09 +01:00
Martin Milata
27bd4198a5 fix(crypto): unify AES context layout on GCC and clang (bindgen)
[no changelog]
2025-11-18 19:55:09 +01:00
cepetr
5226cb5eea fix(core): relocate const globals to .rodata
[no changelog]
2025-11-13 09:01:37 +01:00
Ondřej Vejpustek
8ea41b3c96 fix(crypto): fix empty array warning
[no changelog]
2025-11-10 15:22:26 +01:00
cepetr
dfb72957f1 fix(core): get rid of confidential global vars
[no changelog]
2025-10-29 09:00:15 +01:00
cepetr
4bfcb7ef33 refactor(crypto): get rid of random_xor() function
[no changelog]
2025-09-24 15:51:02 +02:00
cepetr
6f789233fc refactor(core): originate random number always from sec/rng
[no changelog]
2025-09-24 15:51:02 +02:00
Roman Zeyde
d166c9e707 build(crypto): fix CI build error
[no changelog]
2025-09-10 14:50:57 +03:00
matejcik
87f5f12d64 style: update to black 25 style, silence new flake8 warnings
[no changelog]
2025-09-08 16:27:44 +02:00
Ondřej Vejpustek
58245dd51d feat(core/prodtest): set HSM public keys
[no changelog]
2025-09-02 18:51:31 +02:00
Andrew Kozlik
57d462d80c feat(core/prodtest): Check for device S/N in device certificates.
[no changelog]
2025-08-29 15:59:57 +02:00
Ondřej Vejpustek
6d85ae5f87 refactor(crypto): make response constant 2025-07-10 20:22:12 +02:00
Andrew Kozlik
2abf41b57c test(crypto): Test ECDSA private key masking. 2025-07-08 22:27:55 +02:00
Andrew Kozlik
1ff04d10c6 feat(crypto): Add ECDSA private key masking functions. 2025-07-08 22:27:55 +02:00
Andrew Kozlik
d933598df4 feat(core): Implement derivation from master key in secret API.
[no changelog]
2025-06-28 09:52:37 +02:00
Ondřej Vejpustek
a684d6f1ed refactor(core/prodtest): check subject common name 2025-06-25 15:41:03 +02:00
Ondřej Vejpustek
309e88ffc7 feat(crypto): implement noise KK1 2025-06-25 15:40:39 +02:00
Martin Milata
19f30acfbb refactor(legacy): check size of integers when hashing
[no changelog]
2025-04-25 13:22:09 +02:00
Pavol Rusnak
9037c398eb chore(crypto): use new email for stick 2025-04-20 22:04:38 +02:00
Andrew Kozlik
91ee49c20b chore(core, crypto): Remove unused function mnemonic_generate().
[no changelog]
2025-02-26 17:20:58 +01:00
Ondřej Vejpustek
ecc38f267f fix(crypto): make ge25519_cmove_stride4b constant time 2024-12-16 12:20:11 +01:00
Ondřej Vejpustek
3b49e5400d fix(crypto): remove memory access dependent on secret data 2024-09-26 14:01:47 +02:00
Ondřej Vejpustek
7548fbf9ad refactor(crypto): do not use precomputed table for ed25519 2024-09-26 14:01:47 +02:00
Ondřej Vejpustek
5e36f86291 refactor(crypto): use wrapper instead of ge25519_scalarmult_base_niels 2024-09-26 14:01:47 +02:00
Ondřej Vejpustek
3870e9d2a1 refactor(crypto): introduce symbolic constant for size optimization of ed25519 2024-09-26 14:01:47 +02:00
Ondřej Vejpustek
f246f82b02 style(crypto): fix line breaks and indentation in comments 2024-09-26 13:17:43 +02:00
Ondřej Vejpustek
8bf02cf0a2 style(crypto): format blake and groestl 2024-09-26 13:17:43 +02:00
Ondřej Vejpustek
332c0bf365 refactor(crypto): add missing includes 2024-09-26 13:17:43 +02:00
Ondřej Vejpustek
7a992a593d fix(crypto): fix sign-compare warning 2024-09-12 14:44:33 +02:00
Ondřej Vejpustek
fb471a96f2 refactor(crypto): adapt ripemd160 implementation 2024-09-12 14:44:33 +02:00
Ondřej Vejpustek
3167684d08 refactor(crypto): download ripemd160 implementation 2024-09-12 14:44:33 +02:00
Ondřej Vejpustek
732e21443d refactor(crypto): remove redundant include 2024-09-12 14:44:33 +02:00
Ondřej Vejpustek
c5984af1b5 refactor(crypto): use functions instead of macros in blake2b and blake2s 2024-09-12 14:44:33 +02:00
Ondřej Vejpustek
32356b8123 refactor(crypto): use functions instead of macros in groestl512 2024-09-12 14:44:33 +02:00
Ondřej Vejpustek
cb9c56e83f refactor(crypto): remove unused macros in groestl512 2024-09-12 14:44:33 +02:00
Ondřej Vejpustek
729da01b88 tests(crypto): test groestl512 2024-09-12 14:44:33 +02:00
Ondřej Vejpustek
b0e703f988 refactor(crypto): introduce symbolic constants for size optimization 2024-09-12 14:44:33 +02:00
Ondřej Vejpustek
0bdbd924c1 refactor(crypto): optimize size of AES 2024-09-12 14:44:33 +02:00
Ondřej Vejpustek
c8b811bac5 refacor(crypto): refactor hdnode_public_ckd
[no changelog]
2024-08-23 17:00:52 +02:00
Ondřej Vejpustek
dd6d48aff3 refactor(crypt): remove unused function
[no changelog]
2024-08-23 17:00:52 +02:00
Ondřej Vejpustek
a12a81a321 feat(crypto): introduce ecdsa_tweak_public_key
[no changelog]
2024-08-23 17:00:52 +02:00
Ondřej Vejpustek
a5fd5e179f refactor(crypto): use goto cleanup
[no changelog]
2024-08-23 17:00:52 +02:00