Leaflet
Leaflet copied to clipboard
Migrate cryptography to rust
This comes with many benefits such as:
-
Speed. In fact, in our testing, backup times are slashed to under a second for 100 notes in debug mode. This can be improved by reducing memory copying and enabling hardware AES and SIMD in
rustcflags. -
Auditability. We use audited cryptography libraries such as
ringandaes-gcmwhich provide better security. -
Predictability. Due to the lack of a runtime, boxing and unboxing, the speed is predictable reducing many attacks which depend on timing information. The libraries are made to be run in constant-time which further improves security.
Todo
- [ ] Setup build scripts to use hardware AES, SIMD and LTO when available
- [X]
x86_64-pc-msvc-windows - [X]
x86_64-linux-android - [X]
aarch64-linux-android - [X]
armv7-linux-androideabi - [X]
x86_64-apple-ios - [X]
x86_64-apple-darwin - [X]
aarch64-apple-ios - [X]
aarch64-apple-ios-sim
- [X]
- [x] Remove debug log statements I added for testing
- [x] Improve error checking on the rust side
- [ ] ~~Perform final compatibility testing (some old backups fail to restore,
List<int>toUint8Listissue migration suspected).~~ Implementations are 100% compatible. The system errors out withnullfolder,last_changed. Need to retain backwards compatibility with old backups @HrX03 - [ ] Integrate cargo with build systems for
- [X] Windows
- [X] Android
- [ ] Linux
- [x] iOS
- [x] macOS
- [x] Add documentation for
- [x] How to build
- [x] Algorithm and file format
Signed-off-by: Akshit Garg [email protected]