42 Commits

Author SHA1 Message Date
kaczmarczyck
99f81adc55 RustCrypto in TockEnv (#625)
* Adds a rust_crypto feature to Tock

* -O3 for RustCrypto
2023-05-05 22:38:56 +02:00
kaczmarczyck
f25cdd6acc Tock V2 port - rebased and updated (#620)
* Changes from #580

* fixes USB cancel panic

* style fixes

* Update src/env/tock/storage.rs

Co-authored-by: Zach Halvorsen <zhalvorsen@google.com>

---------

Co-authored-by: Zach Halvorsen <zhalvorsen@google.com>
2023-05-05 09:55:16 +02:00
kaczmarczyck
5f7eb3177b Cryptographic Secret type (#615)
* Adds a type for cryptographic secrets

* default implementations and zeroize documentation

* removes whitespace
2023-04-19 18:02:48 +02:00
kaczmarczyck
3091b5a29d Moves vendor commands into TockEnv (#614)
This move changes the Env trait: It removes all functionality that is
used only in vendor commands (`FirmwareProtection`, `UpgradeStorage`)
and adds a function to call when parsing CBOR commands.

The abstraction necessary to test these commands is instead realized
through compile flags. The mock upgrade storage is active when compiled
for std for example.
2023-04-17 00:17:37 +02:00
kaczmarczyck
be42b47caf Replaces Rng256 with new Rng API (#612)
* Replaces the Rng256 with RngCore from rand_core

The old trait was designed with our software crypto in mind. We should
use a more standard API going forward.

- Removes libraries/rng256/
- Ports libraries/crypto/ to rand_core
- Moves the used RNG trait to api/

* Use StdRng directy in TestEnv
2023-04-11 10:23:38 +02:00
kaczmarczyck
3135c13e6b Moves the TockEnv implementation of RNG to env/ (#599)
This change removes the tock dependencies from non-Tock envs.
2023-03-06 11:21:48 +01:00
Julien Cretin
f57126634b Allow read_slice to return a Vec 2022-06-03 11:16:43 +02:00
kaczmarczyck
4782d7e186 Separate RNG library (#470)
* seperates the RNG library

* fixes crypto tests

* adds rng256 workflow

* fixes formatting
2022-04-28 11:36:43 +02:00
kaczmarczyck
7e7d5e38a1 enforces Module imports granularity (#445) 2022-03-14 20:44:48 +01:00
Julien Cretin
dc00b94ee8 Remove steal_storage 2022-03-07 19:43:58 +01:00
Julien Cretin
c4a27bf935 Add Storage and UpgradeStorage to Env 2022-03-03 17:37:28 +01:00
Julien Cretin
b59df7001f Remove the software-specific Decrypt16BytesBlock and Encrypt16BytesBlock traits
They assume blocks are encrypted/decrypted one at a time. To avoid one syscall
per block, it is preferable to encrypt/decrypt the data at once.

Change-Id: I795c8f5b7901a1b55fa3b06fa45fe57ab19d06ea
2022-01-26 11:05:02 +01:00
kaczmarczyck
522e6079e3 Forward desktop test fixes (#419)
* fixes clippy warnings for compilers until 2021-11-25

* fixes run_desktop_tests

* removes page_size
2021-11-30 11:07:17 +01:00
Julien Cretin
4eb7f02985 Remove useless retry-loop
This was needed in the past although we would never enter the loop. But call
unwrap directly would fail.
2021-10-08 08:39:29 +02:00
Julien Cretin
2d5fdd1034 Configure the number of pages in the board
This permits to have portable apps.
2021-09-13 18:50:13 +02:00
Jean-Michel Picod
c1f2551d0d Bump Tock kernel version (#374)
* Bump Tock kernel version

* Update boards to new kernel

* Update patches to new kernel

* Update PR template

* Bump libtock-rs

* Use new layout from libtock-rs

* Fix clippy warnings due to updated toolchain

* Fix new toolchain file format

* Bump elf2tab to v0.7.0

* Fix worklow and setup.sh script to use the TOML rust-toolchain file

* New libtock-rs style of declaring the stack.

* Fix padding in layout file.

The layout from libtock-rs generates invalid flash padding.
The value is 32-bit and therefore setting padding to 0xff yields
0xff000000 instead of 0xffffffff that we want.

* adds tock patch for app break hard fault

* sets in deploy, removed patch 04-mpu-fix

* fixed the if deploy

* fixes indentation

* updates board names in install.md

* fix docs and deploy style

Co-authored-by: Fabian Kaczmarczyck <kaczmarczyck@google.com>
Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
2021-09-10 08:32:34 +02:00
Julien Cretin
ad0605c2fa Make flash syscall interface async 2021-08-07 11:29:07 +02:00
Julien Cretin
7bb4960730 Output copy/paste table for store latency 2021-08-03 09:03:49 +02:00
Julien Cretin
58ae1ac8b1 Update store latency numbers (#354)
The main difference comes from c03605aa0c where we
started using -Oz instead of -O. A similar difference in latency is probably
expected in crypto and cbor too.
2021-08-02 16:15:52 +02:00
Julien Cretin
2cd760bad7 Merge branch 'develop' into v2_optim 2021-01-18 16:10:08 +01:00
Julien Cretin
f67fdbc451 Add erase_storage application example 2020-12-22 16:17:02 +01:00
Julien Cretin
edcc206e9d Make store operations constant wrt flash operations 2020-12-10 18:41:32 +01:00
Julien Cretin
371b8af224 Move choice between prod and test storage to embedded_flash module
This way all users of storage can share the logic to choose between flash or RAM
storage depending on the "std" feature. This is needed because the store_latency
example assumes flash storage but is built when running `cargo test
--features=std`.
2020-12-10 18:04:25 +01:00
Julien Cretin
869e932349 Add asserts to make sure we compact 2020-12-10 16:51:30 +01:00
Julien Cretin
ae08221cdb Add latency example 2020-12-10 13:31:25 +01:00
Mirna
84dec3f636 Update in the application's workflow 2020-11-10 16:57:31 +02:00
Mirna
203367b081 Updated control flow + cleaned some code 2020-11-05 10:38:59 +02:00
Mirna
0eaa2b5291 Refactor a match expression 2020-11-04 20:25:30 +02:00
Mirna
c232f2344c Resolve comments 2020-11-04 20:05:32 +02:00
Mirna
eb31876807 Update to calculate elapsed time for transmission 2020-11-04 17:48:50 +02:00
Mirna
dd814b8ded Remove duplicate code 2020-11-02 10:49:00 +02:00
Mirna
69194f3960 Updates in the application logic 2020-10-29 23:07:23 +02:00
Mirna
16870d52c5 Update the application logic 2020-10-22 12:15:24 +02:00
Mirna
9205974b50 Update nfct_test example to test NFC driver. 2020-10-16 08:06:42 +02:00
Mirna
00ab3c8877 Fixes for some unsuccessful checks 2020-10-16 08:06:42 +02:00
Mirna
929aaf3ba2 Update in libtock-drivers/ and nfct_test.rs application 2020-10-16 08:06:42 +02:00
Mirna
d36cac1a33 Add NFC example application 2020-10-16 08:06:42 +02:00
Guillaume Endignoux
68b0bdc29b Fix more Clippy warnings. 2020-09-29 11:05:24 +02:00
Guillaume Endignoux
85a34ad085 Migrate import statements and macros to Rust 2018. 2020-09-24 11:28:24 +02:00
Guillaume Endignoux
a3b9724165 Add console_test example to stress-test Tock's console driver. 2020-09-22 16:33:52 +02:00
Guillaume Endignoux
e60e10e777 Add examples for panic_test and oom_test. 2020-08-07 15:09:07 +02:00
Jean-Michel Picod
f91d2fd3db Initial commit 2020-01-30 11:47:29 +01:00