~yujiri/libsufec

a8d2146c7a115ffee5636bb7696c28026f896491 — Yujiri 2 years ago 1aa84cb
refactor
1 files changed, 1 insertions(+), 2 deletions(-)

M src/crypto.rs
M src/crypto.rs => src/crypto.rs +1 -2
@@ 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)
}