Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

rust: update repository layout docs

Prateek Sunalf658584b7182
diff --git a/rust/README.md b/rust/README.md
index df6e28ab72..9b341fd7ad 100644
--- a/rust/README.md
+++ b/rust/README.md
@@ -48,11 +48,26 @@ rust/
β”‚ β”œβ”€β”€ Cargo.toml
β”‚ └── Cargo.lock
β”‚
-└── core/ # Pure Rust business logic
+β”œβ”€β”€ core/ # Pure Rust business logic
+β”‚ β”œβ”€β”€ src/
+β”‚ β”‚ β”œβ”€β”€ lib.rs
+β”‚ β”‚ └── urls.rs
+β”‚ └── Cargo.toml # crate name: ente-core
+β”‚
+└── validation/ # Crypto validation + benchmarks vs libsodium
β”œβ”€β”€ src/
- β”‚ β”œβ”€β”€ lib.rs
- β”‚ └── urls.rs
- └── Cargo.toml # crate name: ente-core
+ β”‚ β”œβ”€β”€ main.rs
+ β”‚ └── bin/
+ β”‚ └── bench.rs
+ β”œβ”€β”€ wasm/ # WASM bench bindings
+ β”‚ β”œβ”€β”€ src/
+ β”‚ β”‚ └── lib.rs
+ β”‚ └── Cargo.toml # crate name: ente-validation-wasm
+ β”œβ”€β”€ js/ # JS + WASM benchmarks
+ β”‚ β”œβ”€β”€ bench-wasm.mjs
+ β”‚ β”œβ”€β”€ bench-wasm-browser.mjs
+ β”‚ └── bench-wasm-browser.html
+ └── Cargo.toml # crate name: ente-validation
web/packages/wasm/ # WASM bindings (lives in web workspace)
β”œβ”€β”€ src/
@@ -80,6 +95,7 @@ mobile/apps/photos/rust/ # Photos app-specific FRB bindings
**Crates:**
- `ente-core` - shared business logic (pure Rust, no FFI)
+- `ente-validation` - validation + benchmarks vs libsodium
- `ente-wasm` - wasm-bindgen wrappers for web
- `ente_rust` - shared FRB wrappers for mobile (Dart class: `EnteRust`)
- `ente_photos_rust` - Photos app-specific FRB (Dart class: `EntePhotosRust`)
@@ -128,6 +144,39 @@ cargo build # build
cargo test # test
```
+**ente-validation (rust/validation/):**
+
+```sh
+cargo run -p ente-validation --bin ente-validation # validation suite
+cargo run -p ente-validation --bin bench # benchmarks (debug)
+cargo run -p ente-validation --bin bench --release # benchmarks (release)
+```
+
+**ente-validation wasm benchmarks (rust/validation/):**
+
+Node (rust-core wasm vs libsodium-wrappers-sumo wasm):
+
+```sh
+wasm-pack build --target nodejs rust/validation/wasm # wasm bench build
+cd rust/validation/js
+npm install
+node bench-wasm.mjs # wasm benchmarks
+```
+
+Browser (Chrome):
+
+```sh
+wasm-pack build --target web rust/validation/wasm
+cd rust/validation
+python3 -m http.server 8000
+```
+
+Open:
+
+```text
+http://localhost:8000/js/bench-wasm-browser.html
+```
+
**ente-wasm (web/packages/wasm/):**
```sh