feat: optimize
This commit is contained in:
@@ -124,7 +124,7 @@ impl EncEncryptedMeta {
|
||||
pub fn seal(&self, crypto: Cryptor, key_nonce: &KeyNonce) -> XResult<Vec<u8>> {
|
||||
let mut encrypted_meta_json = serde_json::to_vec(self).unwrap();
|
||||
encrypted_meta_json = opt_result!(
|
||||
compress::compress(Compression::default(), &encrypted_meta_json), "Compress encrypted meta failed: {}");
|
||||
compress::compress_default(&encrypted_meta_json), "Compress encrypted meta failed: {}");
|
||||
let encrypted = opt_result!(crypto_simple::encrypt_with_salt(
|
||||
crypto, key_nonce, SALT_META, encrypted_meta_json.as_slice()), "Encrypt encrypted meta failed: {}");
|
||||
Ok(encrypted)
|
||||
|
||||
Reference in New Issue
Block a user