diff --git a/secret_store/src/key_server_cluster/io/message.rs b/secret_store/src/key_server_cluster/io/message.rs index 32f0fc54a..94030ef41 100644 --- a/secret_store/src/key_server_cluster/io/message.rs +++ b/secret_store/src/key_server_cluster/io/message.rs @@ -19,7 +19,7 @@ use std::u16; use std::ops::Deref; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use serde_json; -use ethcrypto::ecies::{encrypt_single_message, decrypt_single_message}; +use ethcrypto::ecies; use ethkey::{Secret, KeyPair}; use ethkey::math::curve_order; use ethereum_types::{H256, U256}; @@ -241,7 +241,7 @@ pub fn deserialize_message(header: &MessageHeader, payload: Vec) -> Result Result { let mut header: Vec<_> = message.into(); let payload = header.split_off(MESSAGE_HEADER_SIZE); - let encrypted_payload = encrypt_single_message(key.public(), &payload)?; + let encrypted_payload = ecies::encrypt(key.public(), &[], &payload)?; let header = deserialize_header(&header)?; build_serialized_message(header, encrypted_payload) @@ -249,7 +249,7 @@ pub fn encrypt_message(key: &KeyPair, message: SerializedMessage) -> Result) -> Result, Error> { - Ok(decrypt_single_message(key.secret(), &payload)?) + Ok(ecies::decrypt(key.secret(), &[], &payload)?) } /// Fix shared encryption key.