cleanup: derive argon cap directly in library_api range test

The range-decrypt test filled max_argon_memory_mib by building a whole
DecryptOptions::default() and reading one field out of it, which runs
thread and memory detection just to extract a u32. The library already
exports default_argon_decrypt_cap_mib(), which is the value that
default actually uses and says what is meant - call it directly.

Test-only change.

Test plan: cargo test --test library_api passes both tests.
This commit is contained in:
2026-06-12 22:54:47 +02:00
parent f370beb19f
commit 7f49d034ae
+2 -1
View File
@@ -9,6 +9,7 @@ use fcry::{
SecretBytes32, SecretBytes32,
decrypt, decrypt,
decrypt_range, decrypt_range,
default_argon_decrypt_cap_mib,
encrypt, encrypt,
}; };
use tempfile::TempDir; use tempfile::TempDir;
@@ -73,7 +74,7 @@ fn library_range_decrypt_raw_key() {
output_file: Some(out.clone()), output_file: Some(out.clone()),
offset: 1234, offset: 1234,
length: 20_000, length: 20_000,
max_argon_memory_mib: DecryptOptions::default().max_argon_memory_mib, max_argon_memory_mib: default_argon_decrypt_cap_mib(),
output: OutputOptions::default(), output: OutputOptions::default(),
}; };
decrypt_range(&range_options, Some(&key), None).unwrap(); decrypt_range(&range_options, Some(&key), None).unwrap();