Rewrite vault in Rust (format-compatible with 0.5) #1

Merged
andydixon merged 19 commits from rust-port into master 2026-10-08 18:38:32 +02:00
4 changed files with 6 additions and 2 deletions
Showing only changes of commit 24ebede9bb - Show all commits
+1
View File
@@ -15,3 +15,4 @@ pub mod rng;
pub mod secret;
pub mod store;
pub mod util;
pub mod net;
+3
View File
@@ -0,0 +1,3 @@
// SPDX-License-Identifier: GPL-3.0-or-later
//! Network import: `add URL` and `mirror`. (Being written.)
+1 -1
View File
@@ -765,7 +765,7 @@ fn write_filler(root: &Path, target: u64, pool: Arc<Pool>, entropy: Entropy) ->
let mut rng = entropy.rng(b"filler");
let throwaway = Identity::generate(&mut rng);
let s = Store::new(root, throwaway, pool, true, entropy);
let upper = (target / 8).max(CHUNK_SIZE).min(1 << 30) as f64;
let upper = (target / 8).clamp(CHUNK_SIZE, 1 << 30) as f64;
let count = FILLER_MIN + rng.below(FILLER_MAX - FILLER_MIN + 1);
let mut cat = Catalogue::default();
let (mut i, mut total) = (0u64, 0u64);
+1 -1
View File
@@ -323,7 +323,7 @@ mod tests {
let text = r["json"].as_str().unwrap();
assert_eq!(
&enc[..],
text["{\"name\":".len()..text.find(",\"seed\"").unwrap()].as_bytes(),
&text.as_bytes()["{\"name\":".len()..text.find(",\"seed\"").unwrap()],
"escaping of {n:?}"
);
if VaultName::new(n).is_none() {