Skip to content

armgit / ente

Public Imported from GitHub
0

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

rust/core: export crypto module and fix memlimit check

Prateek Sunal43e87e57ae2d
diff --git a/rust/core/src/crypto/impl_pure/argon.rs b/rust/core/src/crypto/impl_pure/argon.rs
index 9dec2acd1c..30e6a72171 100644
--- a/rust/core/src/crypto/impl_pure/argon.rs
+++ b/rust/core/src/crypto/impl_pure/argon.rs
@@ -203,7 +203,7 @@ pub fn derive_sensitive_key_with_salt_adaptive(
});
}
- if MEMLIMIT_SENSITIVE % MEMLIMIT_MODERATE != 0 {
+ if !MEMLIMIT_SENSITIVE.is_multiple_of(MEMLIMIT_MODERATE) {
return Err(CryptoError::InvalidKeyDerivationParams(format!(
"Memory limit {} must be divisible by {}",
MEMLIMIT_SENSITIVE, MEMLIMIT_MODERATE
diff --git a/rust/core/src/lib.rs b/rust/core/src/lib.rs
index d70864eb81..57252f75e3 100644
--- a/rust/core/src/lib.rs
+++ b/rust/core/src/lib.rs
@@ -1,4 +1,5 @@
//! Core library for Ente clients.
+pub mod crypto;
pub mod http;
pub mod urls;