1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 23:48:12 +00:00
Commit Graph

183 Commits

Author SHA1 Message Date
tychovrahe
d3284baf21 feat(core): support STM32F429 discovery board 2023-06-15 17:08:14 +02:00
tychovrahe
8154e5103f refactor(core): make emulated dma2d usable outside of emulator
[no changelog]
2023-06-15 17:08:14 +02:00
grdddj
ef2d2a3e75 feat(core/rust): make font changes for TR
[no changelog]
2023-06-14 18:17:09 +02:00
grdddj
d199a17cfc feat(core): introduce FONT_BIG as a fifth optional font
[no changelog]
2023-06-14 18:17:09 +02:00
tychovrahe
8d812ca36e feat(core): support device variants
[no changelog]
2023-06-07 19:48:53 +02:00
tychovrahe
a2f8cb9d1c feat(core): add internal model field to features
[no changelog]
2023-06-06 09:39:45 +02:00
grdddj
da14c22712 feat(all): add UI for Model R 2023-05-31 10:14:54 +02:00
grdddj
17a07c3d1a chore(core): refactor UI code in SSonscripts 2023-05-11 21:02:21 +02:00
grdddj
8ee4c41938 chore(crypto): refactor slip39 same way as bip39 2023-05-11 21:02:21 +02:00
tychovrahe
e578f7f0f8 refactor(core): remove unused C display_icon and display_loader functions
[no changelog]
2023-04-25 10:28:33 +02:00
Martin Milata
3fb3f108cc chore(vendor): bump micropython to 1.19.1
Relevant micropython commits:
  01374d941f9d7398e35990b574769b20c6779457 py/mpconfig.h: Define initial templates for "feature levels".
  7b89ad8dbf432ab51eea6d138e179bf51394c786 py/vm: Add a fast path for LOAD_ATTR on instance types.
  68219a295c75457c096ac42dbe8411b84e1e1a51 stm32: Enable LOAD_ATTR fast path, and map lookup caching on >M0.
  e0bf4611c3a8b23b3c52e6a7804aac341ac3a87d py: Only search frozen modules when '.frozen' is found in sys.path.
  f2040bfc7ee033e48acef9f289790f3b4e6b74e5 py: Rework bytecode and .mpy file format to be mostly static data.
  926b554dafffa1e9bd80aa12fea5c621221c9d79 extmod/moduos: Create general uos module to be used by all ports.
  2b409ef8a46015f8f3bd20bc44e644637dbe9bd3 unix/moduos: Convert module to use extmod version.
  47f634300c5572571816817f16836113c98814ae py: Change makemoduledefs process so it uses output of qstr extraction.
  0e7bfc88c6ac6b5d64240f91183a3cfe2ab67ade all: Use mp_obj_malloc everywhere it's applicable.
  2a6ba47110be88ff1e1f5abd1bd76c353447884c py/obj: Add static safety checks to mp_obj_is_type().
2023-04-21 13:14:07 +02:00
tychovrahe
83500487b8 refactor(core): improve conditional compilations based on model
[no changelog]
2023-04-19 21:36:51 +02:00
tychovrahe
6ea68baf34 refactor(core): move files out of extmod
[no changelog]
2023-04-19 21:36:51 +02:00
Martin Milata
69bc442c90 fix(core/ui): replace RobotoMono Regular with RobotoMono Medium
[no changelog]
2023-04-04 00:15:12 +02:00
Martin Milata
4199d4ad41 fix(core/ui): style update: fonts
[no changelog]
2023-03-23 20:16:22 +01:00
Ondrej Mikle
a5f7c19f7e fix(core/bootloader): do not use insecure LCG PRNG. Change insecure PRNG to be opt-in, not opt-out 2023-03-22 10:21:21 +01:00
Martin Milata
4622aec0f1 refactor(core): switch to Rust implementation of QR-Code-generator
[no changelog]
2023-03-09 23:36:36 +01:00
tychovrahe
5a991f3244 feat(core/rust): bootloader implementation in rust 2023-03-09 16:14:36 +01:00
tychovrahe
ead61d1e90 refactor(core): improve flexibility of build, allow different touch panel driver, allow STM32F429
[no changelog]
2023-03-02 15:56:33 +01:00
tychovrahe
9748a56a55 chore(core): automatic generation of CMakeLists
[no changelog]
2023-02-02 11:32:37 +01:00
grdddj
f8c432e955 chore(core/rust): delete model_1 code - it should use model_r
[no changelog]
2023-01-31 10:55:12 +01:00
grdddj
b08a6fe2c1 chore(core): delete unused code from micropython UI
[no changelog]
2023-01-25 19:17:56 +01:00
Martin Milata
5b3db7eca1 refactor(core/rust/ui): homescreen layouts
[no changelog]
2022-12-13 17:15:15 +01:00
matejcik
ff2d1c3f1f feat(core/ui): drop T1 UI (fixes #2639)
[no changelog]
2022-11-24 13:03:34 +01:00
grdddj
61277bd80a feat(core/ui): implement webauthn layouts for UI2
[no changelog]
2022-11-24 13:03:34 +01:00
tychovrahe
0d733d8e22 feat(core): change display type for model R
[no changelog]
2022-11-24 11:37:52 +01:00
grdddj
bd6f3d5f46 chore(core/ui): delete altcoin.py file 2022-11-21 14:08:47 +01:00
grdddj
d045e0089d feat(core/ui): delete old UI code 2022-11-21 14:08:47 +01:00
Martin Milata
18352acce8 feat(core/rust/ui): replace TT Hoves Medium with DemiBold style
[no changelog]
2022-10-22 01:39:53 +02:00
Andrew Kozlik
d815a7d6de chore(core): Use C implementation of Bech32 decode. 2022-10-17 15:20:46 +02:00
tychovrahe
11748b7641 fix(build): fix ASAN build with num_derive crate
[no changelog]
2022-10-10 13:49:50 +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
tychovrahe
223d1b20fb refactor(core): change fonts organization 2022-09-29 21:50:10 +02:00
Tomas Krnak
031bac4a9b feat(core): add support for Zcash unified addresses 2022-08-30 21:15:49 +02:00
Andrew Kozlik
054b5456d2 chore(core): Decrease ECMULT_GEN_PREC_BITS to save 32kB of flash space. 2022-08-30 15:53:44 +02:00
grdddj
9dc73427fb feat(rust): add print! macro for logging into terminal 2022-07-20 12:46:01 +02:00
matejcik
2aa427a6e3 feat(core/rust): make Rust buildable without Micropython
Features `micropython` and `protobuf` are defined. Protobuf implies micropython
because our protobuf impl is pretty much _for_ micropython.

The respective subdirs are included only if the matching feature is defined.

util.rs is moved to micropython because it mostly concerns micropython interop

ResultExt, useful only for ui_debug, is moved to ui::util.

A new module `trezorhal::time` is provided. It mirrors functionality of
`micropython::time` via stmlib functions.  The intended use is to always use
functions from `trezorhal::time`. The right micropython variants are used when
micropython is available, otherwise the pure stmlib versions are called.

ui::*::layout is conditional for micropython feature, because it only concerns
micropython layouts. If we want to reuse layouts defined there, we will need to
export them to not depend on Objs and Qstrs etc.
2022-06-16 13:08:07 +02:00
matejcik
dfa4b1d9a1 build: add bip39_english.o where appropriate
[no changelog]
2022-06-01 16:35:33 +02:00
Ondřej Vejpustek
db0da196a8 chore(vendor): update secp256k1-zkp to latest 2022-05-16 16:23:18 +02:00
tychovrahe
f7a3aad9bd feat(core): initial Model R display implementation with framebuffer 2022-05-10 16:49:23 +02:00
grdddj
6b5f578d02 feat(core): implement basic R emulator
Can be built by `TREZOR_MODEL=R make build_unix`, `make build_unix_frozen` does not work yet.

All the dialogs are not very pretty, they are just meant to work.
2022-05-06 11:44:52 +02:00
Tomas Krnak
9985a72c6a feat!(core): support Zcash v5 transaction format
This implements:
- ZIP-225: Version 5 Transaction Format
- ZIP-244: Transaction Identifier Non-Malleability

BREAKING CHANGE: Zcash prevouts are not verified (as in Taproot). Zcash replacement transactions are not supported.
2022-05-02 16:07:31 +02:00
Pavol Rusnak
a411a964e1 fix(core): re-enable passing of TREZOR_EMULATOR_RASPI flag
to re-enable build of Emulator for Raspberry Pi with a display

related to commit daf0d77 which removed the functionality from the makefile
but we missed that there is now no way how to pass the flag to emit the #define

[no changelog]
2022-04-29 13:55:11 +02:00
Pavol Rusnak
8f1d33d5f9 build(core,legacy): remove gcc, use cc instead of gcc
for firmware builds we still use arm-none-eabi-gcc via $(PREFIX)gcc

[no changelog]
2022-04-27 15:48:14 +02:00
TychoVrahe
7912a7d0d3
build(core,storage): fix conditional compilation for different Trezor models
* build(core,storage) - Fix conditional compilation for different trezor models

* build(core) - Rename MODEL_* macro to TREZOR_MODEL_*, remove the original TREZOR_MODEL macro (replaced by conditional compilation for QSTR generation)

* build(core) - fixed missing TREZOR_MODEL to TREZOR_MODEL_x changes

[no changelog]
2022-04-26 13:47:40 +02:00
Martin Milata
2f987c3c5e refactor(core/ui): remove dependencies on old layouts
[no changelog]
2022-04-07 17:58:41 +02:00
Martin Milata
4cf917c7cb build(core): fix TREZOR_EMULATOR_DEBUGGABLE
[no changelog]
2022-04-04 13:32:07 +02:00
Pavol Rusnak
6052e71bbb fix(core): fix build with FEATURE_FLAGS.SECP256K1_ZKP=False
[no changelog]
2022-03-18 12:03:41 +01:00
matejcik
390411098a build(core): enable ui_debug for non-frozen emulator 2022-02-18 11:27:23 +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
b46901bc8b feat(core): add TT Hoves fonts, introduce medium variant
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>

[no changelog]
2022-02-10 14:57:42 +01:00
Martin Milata
e3541997f0 ci(core): run nightly device tests with AddressSanitizer
[no changelog]
2022-01-19 15:22:03 +01:00
Martin Milata
e9fd1fc49f build(core/emulator): build with -fPIE
Otherwise "cargo test" fails with errors like:

   Compiling trezor_lib v0.1.0 (embed/rust)
error: linking with `cc` failed: exit status: 1
  |
  = note: ld: build/unix/rust/debug/build/trezor_lib-a046f8e3db087595/out/libcore_lib.a(obj.o): relocation R_X86_64_32S against `.rodata.types.1' can not be used when making a PIE object; recompile with -fPIE
2021-12-06 16:25:59 +01:00
Martin Milata
4d60c10330 feat(core/rust): add support for T1 UI
[no changelog]
2021-11-24 15:36:34 +01:00
Ondřej Vejpustek
3612620268 build(crypto,core): make secp256k1-zkp context as small as possible 2021-11-18 19:05:40 +01:00
Andrew Kozlik
aaceb5bcc6 chore(core): Remove USE_SECP256K1_ZKP_BIP340 build option. 2021-11-13 13:33:46 +01:00
Andrew Kozlik
ae41f7dec8 fix(core): Fix bip340 module build. 2021-11-13 13:33:46 +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
dbfc7d241f chore(vendor,crypto): bump version of secp256k1-zkp 2021-10-25 14:41:28 +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
Pavol Rusnak
d505edaaa0 fix(core): set ECMULT_GEN_PREC_BITS = 4 for secp256k1_zkp
the setting configures size of precomputed static context

size = 64 * (1 << ECMULT_GEN_PREC_BITS) * (256 / ECMULT_GEN_PREC_BITS)

for ECMULT_GEN_PREC_BITS == 2 the size is 64 * 512 == 32 KB
for ECMULT_GEN_PREC_BITS == 4 the size is 64 * 1024 == 64 KB
for ECMULT_GEN_PREC_BITS == 8 the size is 64 * 8192 == 512 KB
2021-10-25 14:41:28 +02:00
Pavol Rusnak
0d6bc43fd5 feat(core): enable secp256k1-zkp 2021-10-25 14:41:28 +02:00
Pavol Rusnak
47e17aab4d fix(core): fix build on aarch64
by adding nlraarch64.c to SConscript.unix
2021-10-22 14:15:21 +02:00
Jan Pochyla
2703d714c2 feat(core): add Rust UI components, layouts, text rendering
[no changelog]
2021-10-07 15:01:55 +02:00
Ondrej Mikle
b905ac04ef fix(core/emulator): Use -Og instead of -O0 in debug emulator builds to avoid segfault
[no changelog]
2021-10-05 14:10:47 +02:00
Jan Pochyla
2c8dec93a6 feat(core): Split unix main, link core obj into Rust test target 2021-09-21 12:43:31 +02:00
Martin Milata
aace875fef chore(vendor): bump micropython to 1.17
Relevant micropython commits:
  d1bfb271d7686708fe8711a177629c8bf6e7f6a6 lib/uzlib: Move uzlib code from extmod to lib.
  4d546713ec8858cbf908de45de11cbfc46a20971 shared: Introduce new top-level dir and move 1st party lib code there.
  ca920f72184c50f61002aa9d5cd01555b1e28b7b py/mpstate: Make exceptions thread-local.
2021-09-17 11:18:14 +02:00
Martin Milata
f37ca13f1a refactor(core): disable SD, SBU, fatfs for T1 build 2021-08-20 12:22:13 +02:00
matejcik
d33d61d84e chore(core): remove Lisk 2021-08-19 10:25:41 +02:00
Martin Milata
2a91052b02 refactor(core/ui): move altcoin and webauthn layouts to separate file
Also fix types.
2021-08-04 15:03:11 +02:00
Martin Milata
312876ab67 refactor(core): convert apps.management.reset_device to layouts 2021-08-04 15:03:11 +02:00
matejcik
fe6c131b14 feat(core/emulator): build emulator with -DSTATIC=
This is perhaps a cleaner way to expose all relevant structures for
memory analysis.
2021-07-14 13:50:24 +02:00
matejcik
c06a93cba5 feat(core/rust): propagate bitcoin_only flag to Rust build 2021-06-08 09:55:19 +02:00
Martin Milata
72557614c4 build(core): update build process for new protobuf
- properly exclude in the trezor/enums folder
- generate Rust protobuf blobs in scons

Split from "tools: Generate special Protobuf blobs for the Rust codec"
2021-06-08 09:55:19 +02:00
Jan Pochyla
8a21e3fc73 feat(core): Add Rust Protobuf codec 2021-06-08 09:55:19 +02:00
Ondřej Vejpustek
8ee17f69b3 refactor(core): move wait_random and rdi into separate file 2021-05-21 13:42:53 +02:00
Jan Pochyla
6257584951 feat(core): Add Rust bindings to MicroPython and trezorhal
core: Remove dangling module decls

core: Use new Cargo feature resolver, use external MacOS debug info

core: Rust docs improvements

core: Upgrade bindgen

core: Add test target to Rust

ci: build rust sources

build(core): .ARM.exidx.text.__aeabi_ui2f in t1 firmware size

It's an unwind table for softfloat function inserted by rustc, probably
can be removed to save 8 bytes:
599c58db70/link.x.in (L175-L182)

scons: Remove dead code

core: Move Rust target to build/rust

core: Replace extern with a FFI version

core: Add some explanatory Rust comments

core: Use correct path for the Rust lib

core: Remove Buffer::as_mut()

Mutable buffer access needs MP_BUFFER_WRITE flag. TBD in the Protobuf PR.

core: Improve docs for micropython::Buffer

core: Minor Rust docs changes

core: Rewrite trezor_obj_get_ll_checked

core: Fix incorrect doc comment

core: Remove cc from deps

fixup! core: Rewrite trezor_obj_get_ll_checked

core: update safety comments
2021-05-05 16:00:21 +02:00
Pavol Rusnak
4649b80b44
feat(core): allow secp256k1-zkp for bitcoin-only build
(but keep it disabled)
2021-03-18 15:42:52 +01:00
Martin Milata
f38abf9d89 refactor(core): introduce layouts
Layouts can be used by the application code to interact with user using
small number of dialogs or other groups of UI components. Each layout is
identified by name and takes some parameters. Most layouts will have an
implementation for each hardware model, mechanism is provided to import
the correct version so that application code can be oblivious to the
model.

This commit introduces the layout concept and converts a couple of
dialogs to use it.
2021-02-10 13:57:19 +01:00
Martin Milata
f1382bf892 refactor(core): model-dependent UI component directories
They now live under trezor.ui.components.tt. Later
trezor.ui.components.t1 will be added and application code will be
rewritten to not use them directly in order to work on both TT and T1.
2021-02-10 13:57:19 +01:00
Pavol Rusnak
43ed13b323 feat(core): disable SECP256K1_ZKP feature flag 2021-01-22 14:06:29 +01:00
Pavol Rusnak
f3d5de15ef refactor(core): turn SECP256K1_ZKP into a firmware feature flag 2021-01-22 14:06:29 +01:00
Martin Milata
c89a8b7bd5 ci(core): add memory profiler job 2020-11-02 14:14:00 +01:00
Pavol Rusnak
ded61a4ccf
chore(vendor): update micropython to v1.13 2020-10-16 14:19:35 +02:00
Martin Milata
c7934116ec
core: introduce TREZOR_MODEL flag (#1233) 2020-08-28 14:50:38 +02:00
Pavol Rusnak
efc5ccdaf0
core: remove src1 2020-08-03 15:59:57 +02:00
Pavol Rusnak
063aba910d core: rename emulator to trezor-emu-core 2020-07-30 15:27:34 +02:00
Pavol Rusnak
9a673db647
core: fix build on T1
file src/apps/base.py was added unconditionally breaking the T1 build
2020-07-28 12:12:53 +02:00
Pavol Rusnak
47e7550423
core/extmod: add font_pixeloperator{,mono}, use this font for T1 2020-07-28 09:40:30 +02:00
Pavol Rusnak
cec87bba50
core: remove mono bold font variant (not used anywhere) 2020-07-27 23:22:34 +02:00
Pavol Rusnak
179645e3ad core: unify usage of TREZOR_MODEL 2020-06-06 21:06:15 +02:00
matejcik
2cedc687e6 core: disable trezor-crypto BIP32 cache 2020-06-04 16:18:46 +02:00
matejcik
d5e45c02bb core: move base functions from "homescreen" app to "base" 2020-06-04 16:18:46 +02:00
Tomas Susanka
445f56d387 core/bitcoin: finalize bitcoin refactor
- core/bitcoin: move common files to the app's root
- core/bitcoin: use require_confirm instead of confirm
- core: move bitcoin unrelated functions from 'bitcoin' to a new 'misc' app
- core/bitcoin: use relative imports inside the app
- core: rename wallet app to bitcoin
- core/wallet: replace SigningErrors and the other exception classes with wire.Errors
2020-05-18 14:31:51 +02:00
Ondřej Vejpustek
d5bfe6b32f crypto: add chacha_drbg 2020-04-16 11:51:28 +02:00
matejcik
4bddeefea0 core: unify mpconfigports for emulator and board
Changes in firmware/mpconfigport.h are minimal:

 * $VFS_FAT is dropped because it is irrelevant without $VFS
 * $REVERSE_SPECIAL_METHODS is added, to push down on code size
 * $THREAD is disabled unconditionally

unix/mpconfigport.h is reordered and modified to match
firmware/mpconfigport.h as much as possible, while selectively enabling
some needed features.

Notably, $USE_READLINE is enabled unconditionally
2020-04-14 10:17:37 +02:00
matejcik
d0f709b8cc core: fix and use MAKEMODULEDEFS instead of explicit registration 2020-04-14 10:17:37 +02:00