@@ 10,11 10,10 @@ pub fn encrypt_message(
recipient_eph: &PublicKey,
message: &Message,
) -> Vec<u8> {
- let message_bytes = message.to_bytes();
let (eph_pub, eph_sec) = gen_keypair();
let shared_key = tripledh(&account.seckey, &eph_sec, recipient_id, recipient_eph);
let nonce = gen_nonce();
- let ciphertext = seal_precomputed(&message_bytes, &nonce, &shared_key);
+ let ciphertext = seal_precomputed(&message.to_bytes(), &nonce, &shared_key);
let concat = [&account.addr.to_bytes(), eph_pub.0.as_ref(), &nonce.0, &ciphertext].concat();
sealedbox::seal(&concat, recipient_id)
}