Commit Graph

21 Commits

Author SHA1 Message Date
Julien Cretin
ae0156d287 Factor test tools between store and fragment
Those need the driver to deal with the fact that the store is stateful. Those
tests can't be moved to the test suite because they use private functions.
2021-01-25 17:30:50 +01:00
Julien Cretin
f0c51950cb Add fragmentation support 2021-01-23 21:27:59 +01:00
Julien Cretin
edcc206e9d Make store operations constant wrt flash operations 2020-12-10 18:41:32 +01:00
Julien Cretin
4253854cf1 Remove ram_storage feature
We don't need to build a production key without persistent storage. Tests and
fuzzing continue to use the std feature to use the RAM implementation (that does
sanity checks).
2020-12-10 13:06:05 +01:00
Julien Cretin
45332158df Add driver for new store 2020-11-03 21:27:32 +01:00
Julien Cretin
233c15b20c Add new store (without tests yet) 2020-11-02 11:17:09 +01:00
Julien Cretin
9778ea7fd2 Introduce distinct integer types
This PR does the following things:
- Give incompatible representations for integers with different semantics:
  - `usize` is used for natural numbers for the public API.
  - `Nat` is used internally for natural numbers (essentially a stable `usize`).
  - `Word` is used for sequences of bits representing words in flash.
  - `Position` is used for word positions in the virtual storage.
- Only use fixed size integers to preserve overflow behavior between targets.
- Use little-endian representation instead of native representation for `Word`.

Alternatives:
- Run tests and fuzzing on 32-bits architecture (or some compatibility mode).
  This approach would have better readability than the current solution (less
  conversions at public API). However it would require additional setup and
  might not be viable long-term by restricting machines on which fuzzing is
  possible.
- Accept the behavior difference for tests and fuzzing. This approach would also
  have better readability. However checking for arithmetic overflow (and other
  `usize` related concerns like memory size) is more important.
2020-10-29 18:48:15 +01:00
Julien Cretin
e7303ed7c6 Add model for new store 2020-10-27 14:23:39 +01:00
Julien Cretin
cb3369213f Fix merge missing conflict 2020-10-23 17:27:20 +02:00
Julien Cretin
3755be1625 Merge branch 'master' into v2_lib 2020-10-23 17:20:19 +02:00
Julien Cretin
f5e6f8728f Do not use nightly features 2020-10-23 08:41:44 +02:00
Julien Cretin
d8f405baab Add missing alloc crate 2020-10-23 08:37:09 +02:00
Julien Cretin
10ac76e58a Add buffer storage for new store 2020-10-23 08:22:30 +02:00
Julien Cretin
f512645837 Improve documentation 2020-10-13 12:46:25 +02:00
Julien Cretin
eede767fe3 Improve documentation 2020-10-12 18:07:29 +02:00
Julien Cretin
0242873a23 Improve comments 2020-10-12 16:25:25 +02:00
Julien Cretin
f9f428dcbf Fix documentation 2020-09-30 18:37:33 +02:00
Julien Cretin
d0ad46b868 Add format helpers for new store 2020-09-30 18:30:39 +02:00
Julien Cretin
67714510f5 Add bitfield helpers for new store 2020-09-28 17:30:44 +02:00
Julien Cretin
ba151d9289 Update copyright dates 2020-09-28 13:14:33 +02:00
Julien Cretin
a203ff13df Create new store and add storage API 2020-09-24 14:24:18 +02:00