Commit Graph

17 Commits

Author SHA1 Message Date
Julien Cretin
410314b780 Move transaction validity check to Format 2020-11-03 12:54:30 +01:00
Julien Cretin
d734da3a0e Move transaction capacity formula to Format 2020-11-03 12:39:38 +01:00
Julien Cretin
b97758dd99 Do not use import ::* 2020-11-03 11:58:20 +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
71815cad09 Update ERASED_WORD definition to use WORD 2020-10-27 13:45:18 +01:00
Julien Cretin
edd1bcf5d2 Do not inline constants in documentation 2020-10-27 11:25:08 +01:00
Julien Cretin
552bab6ba9 Remove public visibility for internal function 2020-10-26 17:51:40 +01:00
Julien Cretin
f8fe1a9493 Add small proofs 2020-10-14 17:36:52 +02:00
Julien Cretin
c098f2695b Clarify current supported values 2020-10-14 12:20:48 +02:00
Julien Cretin
223908febd Remove confusing clarification 2020-10-14 11:41:46 +02:00
Julien Cretin
f512645837 Improve documentation 2020-10-13 12:46:25 +02:00
Julien Cretin
0242873a23 Improve comments 2020-10-12 16:25:25 +02:00
Julien Cretin
d721949806 Improve documentation 2020-10-12 14:40:30 +02:00
Julien Cretin
7b21eba5df Expand documentation 2020-10-09 11:55:51 +02:00
Julien Cretin
c09a5ed719 Address comments 2020-10-07 15:17:37 +02:00
Julien Cretin
d0ad46b868 Add format helpers for new store 2020-09-30 18:30:39 +02:00