diff --git a/src/api.rs b/src/api.rs index bf7cc7b..06713bc 100644 --- a/src/api.rs +++ b/src/api.rs @@ -1279,9 +1279,8 @@ pub fn update_process( for (field, plain_value) in new_attributes.iter() { let hash = new_state.pcd_commitment.get(field).ok_or(anyhow::Error::msg("Missing commitment"))?; let key = generate_key(&mut rng); + let cipher = encrypt_with_key(&key, plain_value.as_slice())?; new_state.keys.insert(field.to_owned(), key); - let serialized = serde_json::to_string(plain_value)?; - let cipher = encrypt_with_key(&key, serialized.as_bytes())?; encrypted_data.insert(hash.to_lower_hex_string(), cipher.to_lower_hex_string()); }