diff --git a/heed/src/envs/env_open_options.rs b/heed/src/envs/env_open_options.rs index ee70d87d..26378470 100644 --- a/heed/src/envs/env_open_options.rs +++ b/heed/src/envs/env_open_options.rs @@ -233,10 +233,22 @@ impl EnvOpenOptions { /// [^7]: /// [^8]: pub unsafe fn open>(&self, path: P) -> Result> { - self.raw_open_with_encryption( + self.raw_open_with_checksum_and_encryption( path.as_ref(), #[cfg(master3)] None, + #[cfg(master3)] + None, + ) + } + + pub unsafe fn open_checksummed>(&self, path: P) -> Result> { + self.raw_open_with_checksum_and_encryption( + path.as_ref(), + #[cfg(master3)] + None, + #[cfg(master3)] + None, ) } @@ -390,16 +402,18 @@ impl EnvOpenOptions { E: AeadMutInPlace + KeyInit, P: AsRef, { - self.raw_open_with_encryption( + self.raw_open_with_checksum_and_encryption( path.as_ref(), + None, Some((Some(encrypt_func_wrapper::), &key, ::TagSize::U32)), ) .map(|inner| EncryptedEnv { inner }) } - fn raw_open_with_encryption( + fn raw_open_with_checksum_and_encryption( &self, path: &Path, + #[cfg(master3)] sum: Option<(ffi::MDB_sum_func, u32)>, #[cfg(master3)] enc: Option<(ffi::MDB_enc_func, &[u8], u32)>, ) -> Result> { let mut lock = OPENED_ENV.write().unwrap(); diff --git a/heed/src/mdb/lmdb_ffi.rs b/heed/src/mdb/lmdb_ffi.rs index 1f68da0e..83264322 100644 --- a/heed/src/mdb/lmdb_ffi.rs +++ b/heed/src/mdb/lmdb_ffi.rs @@ -11,7 +11,7 @@ pub use ffi::{ MDB_RDONLY, MDB_RESERVE, }; #[cfg(master3)] -pub use ffi::{mdb_env_set_encrypt, MDB_enc_func}; +pub use ffi::{mdb_env_set_encrypt, MDB_enc_func, MDB_sum_func}; #[cfg(master3)] use lmdb_master3_sys as ffi; #[cfg(not(master3))]