1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-12 18:49:07 +00:00
Commit Graph

216 Commits

Author SHA1 Message Date
Dusan Klinec
26711857e8 refactor(xmr): remove old BP code 2022-10-25 21:36:03 +02:00
grdddj
8668eba936 feat(core/ui): implement altcoin screens for UI2
[no changelog]
2022-10-24 13:38:31 +02:00
Martin Milata
a7c3a07ef1 refactor(core/rust/ui): implement confirm_properties layout
[no changelog]
2022-10-21 21:02:39 +02:00
Andrew Kozlik
d815a7d6de chore(core): Use C implementation of Bech32 decode. 2022-10-17 15:20:46 +02:00
tychovrahe
f7b9bb4ef8 feat(core/rust): use dma2d to improve rendering performance, implement text over image and icon over icon functions 2022-09-29 21:50:10 +02:00
Martin Milata
5a9c2a1363 feat(core/rust/ui): recovery layouts
[no changelog]
2022-09-07 16:46:47 +02:00
Martin Milata
885ae2a943 refactor(core/rust/ui): add should_show_more
[no changelog]
2022-09-07 16:46:47 +02:00
Martin Milata
3b629a1ea4 refactor(core/rust/ui): layouts for SLIP-39 backups
[no changelog]
2022-09-07 16:46:47 +02:00
Martin Milata
4782afbae3 refactor(core/rust/ui): layouts for BIP-39 backups
[no changelog]
2022-09-07 16:46:47 +02:00
Martin Milata
4ff2c99f0a refactor(core/rust/ui): add show_info and show_error
[no changelog]
2022-09-07 16:46:47 +02:00
Ondrej Mikle
a0287698d5 feat(core): show blue dot when USB data not connected 2022-08-25 16:42:29 +02:00
Andrew Kozlik
fa5e7feda6 fix(crypto): Fix nonce bias in CoSi signing. 2022-08-02 20:38:04 +02:00
matejcik
a6410693b3 Revert "feat(core): implement firmware dumping"
This reverts commit 37c61c1381.
2022-08-02 17:12:07 +02:00
Martin Milata
c9ca7cd544 feat(core/rust/ui): bitcoin layouts
[no changelog]
2022-06-28 18:01:02 +02:00
Martin Milata
24a1f2e25e refactor(core): remove unused parameter from display_qrcode
[no changelog]
2022-06-28 18:01:02 +02:00
Ondrej Mikle
c563c987e1 feat(core): jump back and stay in bootloader for TT via reverse SVC call trampoline 2022-06-01 14:50:59 +02:00
Dusan Klinec
25d32a8144 feat(xmr): implement bp+, refactor, code cleanup
- implement BulletProof plus verifier and prover
- use bulletproof exception to signalize proof generation failed and should be tried again. More robust, fixes bug that was not triggered yet (return tuple did not work properly in all situations)
- precomputed 2**i vector is removed as it can be easily computed
- BP code cleanup, minor optimizations, comments
2022-05-16 12:37:24 +02:00
Dusan Klinec
33c174491f refactor(core/monero): Monero code cleanup
* remove support for HF12 and below
* remove MLSAG support
* clean up monero cryptography naming
* get rid of "optional first argument" pattern, in favor of mandatory argument that is allowed to be None
  (and fix several bugs related to this feature)

Co-authored-by: grdddj <jiri.musil06@seznam.cz>
Co-authored-by: Martin Milata <martin@martinmilata.cz>
Co-authored-by: matejcik <ja@matejcik.cz>
2022-05-16 12:37:24 +02:00
grdddj
7804893179 feat(core/rust): create model_tr feature
Make event.rs shared among all features, under src/ui/event.rs.

[no changelog]
2022-05-06 11:44:52 +02:00
matejcik
37c61c1381 feat(core): implement firmware dumping 2022-05-03 19:00:04 +02:00
Andrew Kozlik
485ee6e209 feat(core): Show progress in GetFirmwareHash. 2022-05-03 19:00:04 +02:00
Andrew Kozlik
822b1c344f feat(core): Return fw_vendor in firmware Features message. 2022-05-03 19:00:04 +02:00
Andrew Kozlik
106ab65e21 feat(core): Implement GetFirmwareHash message. 2022-05-03 19:00:04 +02:00
Martin Milata
1f612580f7 feat(core): enable UI tests for redesigned UI
[no changelog]
2022-04-07 17:58:41 +02:00
Martin Milata
38f4ab0983 feat(core/rust/ui): return Layout results as singleton objects
[no changelog]
2022-04-04 13:32:07 +02:00
Martin Milata
4eefaffac9 fix(core/rust/ui): recovery/passphrase keyboard fixes
[no changelog]
2022-03-23 13:40:45 +01:00
Martin Milata
efe25a6ab4 fix(core/rust/ui): pin keyboard tweaks
[no changelog]
2022-03-23 13:40:45 +01:00
Pavol Rusnak
c6667fa0c2 feat(core): verify bip340 pubkeys used in p2tr addresses
Co-Authored-By: Ondřej Vejpustek <ondrej.vejpustek@satoshilabs.com>
2022-02-16 10:25:15 +01:00
Martin Milata
f2b8822d76 refactor(core): improve build-time option for old/new UI
[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
8fb28e4af5 feat(core/rust): impl Paginate for Paragraphs
[no changelog]
2022-02-08 15:40:37 +01:00
matejcik
45787307ca style(core): support AnyStr in all hash function arguments 2022-01-07 21:41:17 +01:00
grdddj
9fc5bb546b style(core): full pyright-based type-checking
Changes many fields to required -- as far as we were able to figure out,
signing would fail if these fields aren't provided anyway, so this
should not pose a compatibility problem.

Co-authored-by: matejcik <ja@matejcik.cz>
2022-01-07 21:41:17 +01:00
matejcik
1bfaec10e9 build(core): rewrite build_mocks with pathlib, add symlinks to ../mocks 2022-01-07 21:41:17 +01:00
Martin Milata
afd7cb3b01 feat(core/rust): add example layout for T1
[no changelog]
2021-11-24 15:36:34 +01:00
Andrew Kozlik
59c0f4383d feat(core): Add key tweaking functions to trezorcrypto.bip340. 2021-11-13 13:33:46 +01:00
matejcik
f6f52445bd feat(core/cardano): support Icarus, Icarus-Trezor, and Ledger derivations 2021-11-10 13:57:57 +01:00
matejcik
387466e073 refactor(core): separate Cardano cryptography into its own module 2021-11-10 13:57:57 +01:00
matejcik
1d72085b5c feat(core): implement conversion from timestamp to datetime 2021-10-29 11:00:30 +02:00
Ondřej Vejpustek
29ce860d46 refactor(core,crypto): rename schnorr to BIP340 2021-10-25 14:41:28 +02:00
Ondřej Vejpustek
7ac0bdd215 feat(core): make core use Schnorr signatures 2021-10-25 14:41:28 +02:00
Ondřej Vejpustek
26463eb3ce feat(core): make core use ecdsa from secp256k1_zkp wherever possible 2021-10-25 14:41:28 +02:00
Jan Pochyla
2703d714c2 feat(core): add Rust UI components, layouts, text rendering
[no changelog]
2021-10-07 15:01:55 +02:00
Martin Milata
bd005e33df refactor(core): decouple T1 button handling from touch
[no changelog]
2021-09-23 12:30:13 +02:00
matejcik
4b34e4c001 fix(core): allow AnyStr as parameter for unhexlify 2021-09-10 15:09:03 +02:00
matejcik
b41d4c71f0 feat(core/emulator): JSON memory map dump
use `trezor.utils.mem_dump("somefile.json")` in a key place, then
`analyze.py src/somefile.json` to look at what is going on
2021-07-14 13:50:24 +02:00
Jan Pochyla
8a21e3fc73 feat(core): Add Rust Protobuf codec 2021-06-08 09:55:19 +02:00
Pavol Rusnak
23aa69caea fix(core): unify Features.revision reporting with legacy 2021-06-04 12:50:49 +02:00
matejcik
391976bcda refactor(core/usb): do not require serial number on instantiaton of USB
On a cleanly wiped device, storage must be unlocked in order to create
and retrieve the serial number. However, storage unlocking happens in
boot.py, which is imported _after_ usb.py

We must therefore sidestep asking for the serial number.
2021-05-06 13:14:21 +02:00
Martin Milata
ac711fb8ee style(core): use more recent type annotation syntax
https://www.python.org/dev/peps/pep-0585/ - Type Hinting Generics In Standard Collections
https://www.python.org/dev/peps/pep-0604/ - Allow writing union types as X | Y
2021-04-01 11:12:30 +02:00
Martin Milata
8b3ac659a0 style(core): mypy: disable implicit Optional for function arguments
https://www.python.org/dev/peps/pep-0484/#union-types
2021-04-01 11:12:30 +02:00
Andrew Kozlik
2836bfc64c fix(core): Improve error handling and range checking in modtrezorconfig. 2021-03-26 10:54:56 +01:00
Andrew Kozlik
3084d1196d feat(core): Support 50 digit PIN and wipe code. 2021-03-25 14:24:41 +01:00
Andrew Kozlik
a8c500bffd feat(core): Ensure that WebAuthn runs on port 21326 by default for both production and debug emulator. 2021-03-09 16:13:21 +01:00
matejcik
ccd241fe55 feat(core/cardano): enable typing for Cardano app 2021-02-10 10:56:52 +01:00
Martin Milata
db5b65a420 perf(core): enable rendering of substrings to avoid slicing 2021-01-11 16:47:59 +01:00
Andrew Kozlik
aeb021b159 chore(core): Improve naming of SLIP39's T9 mask lookup. 2020-12-15 13:41:42 +01:00
Pavol Rusnak
0036686588 style(core/mocks): use new syntax for typing 2020-12-01 15:52:29 +01:00
Pavol Rusnak
d8534b5ee6
perf(core/extmod): replace HMAC Python implementation with C
We keep Python implementation of HMAC for Monero in
core/src/apps/monero/xmr/crypto/__init__.py
2020-10-12 16:33:13 +02:00
matejcik
7e5d9e295b fix(core): help mypy understand micropython's module management 2020-09-23 16:00:10 +02:00
Martin Milata
163ccedb39 core: allow const() values to have Literal type 2020-09-18 09:02:40 +02:00
Martin Milata
b8bb63fbef core: drop unused FONT_SIZE constant 2020-09-01 19:57:46 +02:00
Martin Milata
1b982659c4
core: fix boot loop after uploading invalid homescreen (#1205) 2020-08-21 12:00:42 +02:00
Pavol Rusnak
4e11735d22 core/modtrezorui: remove prefill from text functions
use display.bar where needed to prefill the areas
2020-08-07 15:08:14 +02:00
Pavol Rusnak
cec87bba50
core: remove mono bold font variant (not used anywhere) 2020-07-27 23:22:34 +02:00
matejcik
fa757f4b7f core: improve type annotation for bip32.derive_path 2020-07-24 16:37:58 +02:00
matejcik
0c3bc53aee core: clean up types for field caching, fix count_message 2020-07-24 14:09:31 +02:00
matejcik
85d74ece76 core: implement synchronous v1 codec 2020-07-24 14:09:31 +02:00
matejcik
872e0fb0e0 core: lower scheduler resolution to milliseconds
This avoids problems with large timeouts causing the scheduler queue to
think the time counter has overflown, and ordering the autolock task before
immediate tasks.

The maximum reasonable time difference is 0x20000000, which in
microseconds is ~8 minutes, but in milliseconds a more reasonable ~6
days.
2020-06-04 16:18:46 +02:00
matejcik
837c4df61f core: expose storage_is_unlocked() as config.is_unlocked() 2020-06-04 16:18:46 +02:00
matejcik
87433995b0 core: add BITCOIN_ONLY to mock file 2020-06-04 16:18:46 +02:00
matejcik
aa52fc3903 core/extmod: drop unused rfc6979 module 2020-05-18 14:31:00 +02:00
matejcik
7f2e7b0003 core: add Ethereum constants to mocks 2020-05-15 14:08:29 +02:00
Pavol Rusnak
197218338a
Merge pull request #936 from trezor/rework-serialize-deserialize
crypto: rework serialize/deserialize API
2020-04-09 09:53:23 +02:00
matejcik
eec0615444 core: drop sys.pyi from mocks (fixes #934)
A change introduced in mypy 0.770 disallows overriding some system
modules, including `sys`.

We only need the override for `sys.print_exception`, and the simplest
solution is to make mypy ignore that particular call.
2020-04-08 11:19:26 +02:00
Pavol Rusnak
a7806d08d7
core/crypto: remove unused bip32.deserialize function 2020-04-06 18:04:24 +02:00
Pavol Rusnak
1695228d80
core/crypto: remove unused serialize_private function 2020-04-06 15:49:36 +00:00
Pavol Rusnak
f07ff17fad
core/crypto: add missing field to Blake2b constructor 2020-04-06 12:28:36 +00:00
matejcik
3789a3372b core/sdcard: modify exception handling in fatfs
expose ff.c constants, raise them as arguments to FatFSError

introduce NotMounted and NoFilesystem as subclasses of FatFSError with
the appropriate error code set
2020-03-20 14:03:28 +01:00
Andrew Kozlik
bfd834d1de storage: Add storage_ensure_not_wipe_code(). 2020-03-19 15:04:33 +01:00
Dusan Klinec
2658e253fa xmr/bp: memory optimizations and improvements
- different approach to vector manipulation - more on the fly operations. Prepared for fully offloaded operations, BP on Trezor with constant memory.
- memory requirements reduced from (4MN + const) to (2MN + const)
- more raw methods to avoid unnecessary encoding/decoding
- chunking improved, chunk size set as a constant, changed from 64 to 32, missing pieces implemented to cover also BP 16
- proof_v8 support discontinued, old hardfork, not needed anymore
- get_exponent register clash fixed (for large vectors)
- reduced heap fragmentation by removing some temporary allocations
- hashing with len and offset to reduce heap fragmentation by creating a sliced arrays
- use to() wherever possible to avoid allocations and return of mutable private object
- global functions start with _ prefix, reduce import footprint
- use __slots__ in classes to minimize footprint
2020-03-02 12:17:03 +01:00
matejcik
9ab84d2455 core/tests: thoroughly test modified APIs 2020-02-27 10:56:23 +01:00
matejcik
fa746e2990 core/fatfs: rework low-level FatFS API
Instead of having possibly multiple FatFS objects, each with its own
`fs` struct, there is one global static fs_instance. This is to match
the mode of operation of ff.c, which assumes a global list of mounts,
and all functions operate on the global based on path.

Methods of FatFS were converted to functions on the fatfs module.

fatfs.unmount() does not call ff.c's unmount, but simply invalidates
fs_instance. This is basically what ff.c would do, except without
messing with ff.c's global list of mounts.
2020-02-26 14:18:41 +01:00
Pavol Rusnak
39ce100608
Merge pull request #864 from trezor/prusnak/bootloader-text-break
core/bootloader: split long vendor string
2020-02-21 18:39:20 +01:00
matejcik
b2084a19be core/trezorio: move sdcard functions to a submodule 2020-02-20 12:51:48 +01:00
Pavol Rusnak
74802a107e
core/modtrezorui: add display_text_split 2020-02-19 21:40:28 +00:00
Pavol Rusnak
32f8f1cb61
core/embed: update fatfs to 0.14; use upstream version 2020-02-07 15:21:16 +00:00
Pavol Rusnak
3de1b3aa54
core/embed: switch to unprivileged in main.c 2020-01-24 12:29:46 +00:00
Tomas Susanka
51ef963738 tests: introduce UI tests for core 2020-01-03 14:28:27 +00:00
Andrew Kozlik
a3b608d8dd storage, core: Reveal the wipe code status after the device is unlocked. 2019-11-25 12:32:20 +01:00
Andrew Kozlik
a168d661cf core: Add support for ChangeWipeCode message. 2019-11-25 12:32:20 +01:00
Tomas Susanka
0511cc8b8c core: add final mypy fixes! 2019-10-22 14:36:25 +00:00
Andrew Kozlik
c25a41aa57 core: Fix mypy warnings in FatFS and SD salt code. 2019-10-09 17:07:25 +02:00
Pavol Rusnak
ad76b5fb9f
core: regenerate mocks 2019-09-25 10:27:04 +00:00
Pavol Rusnak
78041d261b
crypto: refactor bip39 api 2019-09-23 17:56:36 +02:00
Andrew Kozlik
6350b1c61c core: Implement SD card protection. 2019-09-18 18:55:58 +02:00
Andrew Kozlik
4f01003637 storage: Add external salt parameter to unlock() and change_pin(). 2019-09-18 18:53:42 +02:00
Andrew Kozlik
84674a7463 core/usb: Add write_blocking() to trezor.io.HID. 2019-09-11 15:33:16 +02:00
Pavol Rusnak
aa8d14c0ea
core/modtrezorio: add FatFS support 2019-09-03 15:14:24 +02:00
Andrew Kozlik
8297b81cd5 core/crypto: Add AES mode constants. 2019-08-09 12:46:08 +02:00
Andrew Kozlik
0a594ea1e9
Merge pull request #280 from trezor/andrewkozlik/slip-0021
Add SLIP-0021 implementation and tests.
2019-08-06 14:26:34 +02:00
Andrew Kozlik
217c910b4b cardano: Implement SLIP-0023 and add SLIP-0039 support for Cardano. 2019-07-25 19:43:05 +02:00
Tomas Susanka
d2597d54c1 core/shamir: persistence
updates #270
2019-07-24 15:12:04 +02:00
andrew
5f604b5fea core/seed: Add SLIP-0021 implementation and tests. 2019-07-16 14:30:28 +02:00
Jan Pochyla
0f6f05e4b7 core/typing: fix extmod docs and mocks 2019-07-09 14:05:14 +02:00
Jan Pochyla
3af75c0b8b core/typing: improve extmod types 2019-07-09 12:51:48 +02:00
Tomas Susanka
80f8f7900d core: add slip39 support to reset and recovery device 2019-06-23 21:33:58 +02:00
Pavol Rusnak
312224b7a3
core: fix style 2019-06-22 00:18:31 +02:00
Pavol Rusnak
54d348228f
all: rename TREZOR to Trezor where possible 2019-06-17 20:28:29 +02:00
Roman Zeyde
b538eb3375
core/secp256k1_zkp: refactor API into a Context class
In order to prevent frequent memory allocations, the user can create a single
Context object and re-use it between subsequent cryptographic operations.
2019-05-31 17:29:49 +02:00
matejcik
0b50d671e1 make gen && make style 2019-05-17 15:48:57 +02:00
matejcik
482b4569f5 build: fix and auto-generate mock files
Squashed commit of the following:

commit 84d3486f59bda063f06521c8b695ea4b07781ec6
Author: matejcik <ja@matejcik.cz>
Date:   Fri May 17 14:17:15 2019 +0200

    mocks: complete

commit d538133a6d0fb4af06c7c81f80b8675869fb5908
Author: matejcik <ja@matejcik.cz>
Date:   Fri May 17 14:12:26 2019 +0200

    mocks part 3

commit 9f0b868d41dafaf487df6fc844db7f3368eabe1b
Author: matejcik <ja@matejcik.cz>
Date:   Fri May 17 14:09:20 2019 +0200

    mocks: update generated mocks

commit 5d80c18a7824ed16fc11cde4cdb8ebca7ed33400
Author: matejcik <ja@matejcik.cz>
Date:   Thu May 16 15:49:40 2019 +0200

    mocks wip 2

commit 4b576eb796136a61eb88cb0d281fa4e21eadada8
Author: matejcik <ja@matejcik.cz>
Date:   Tue May 7 17:02:51 2019 +0200

    WIP mocks part 1

commit cf3f0d4471ab74b478d2970b0bb178feae7c86a3
Author: matejcik <ja@matejcik.cz>
Date:   Fri May 3 17:07:53 2019 +0200

    core: add package to secp256k1_zkp for mocking

commit 8a12f26c8c0d99363c8df96012426abbbb3ff6cb
Author: matejcik <ja@matejcik.cz>
Date:   Fri May 3 17:04:05 2019 +0200

    core: blackify extmod docstring quotes

commit b6f239676dde8b60b001fcae4e5de80a71dbacf2
Author: matejcik <ja@matejcik.cz>
Date:   Fri May 3 16:52:27 2019 +0200

    core: make build_mocks directory agnostic

mocks: detect bad packages

mocks: revert noqa in favor of setup.cfg

mocks: fix broken comment formatting
2019-05-17 15:45:47 +02:00
matejcik
ffcb5e99cc mocks: fix shamir package 2019-05-17 15:12:41 +02:00
Pavol Rusnak
b5b4a2ca5f
core: remove empty __init__.py files 2019-05-17 11:46:04 +02:00
Pavol Rusnak
c995d9fa59
Revert "ui.display.loader: slice_span added for indeterminate loaders"
This reverts commit 9de96f6114.
2019-04-23 18:31:30 +02:00
Dusan Klinec
9de96f6114
ui.display.loader: slice_span added for indeterminate loaders 2019-04-23 09:15:58 +02:00
matejcik
e5670856a2 MONOREPO CREATE FROM trezor-core 2019-04-15 19:14:40 +02:00