From 4317c9fa5d3011b27259c2d1c6d283083162d751 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sat, 1 Feb 2025 21:47:52 +0100 Subject: [PATCH] renamed why2_chat_ecc_encrypt to why2_chat_ecc_shared_key it will be used only for encrypting WHY2 key --- include/chat/crypto.h | 2 +- src/chat/crypto.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/chat/crypto.h b/include/chat/crypto.h index 1a34497..04a78fe 100644 --- a/include/chat/crypto.h +++ b/include/chat/crypto.h @@ -49,7 +49,7 @@ why2_bool why2_chat_ecc_verify_signature(char *message, char *signature, EVP_PKE char *why2_chat_ecc_serialize_public_key(); //GET PUBLIC ECC KEY IN BASE64 EVP_PKEY* why2_chat_ecc_deserialize_public_key(char *pubkey); //GET EVP_PKEY FROM BASE64 PUBLIC ECC KEY -char *why2_chat_ecc_encrypt(char *message, char *key); //ENCRYPT message WITH ECC key +char *why2_chat_ecc_shared_key(char *message, char *ecc_key); //ENCRYPT message WITH ECC key char *why2_sha256(char *input, size_t length); //HASH input USING SHA256 AND RETURN IN STRING diff --git a/src/chat/crypto.c b/src/chat/crypto.c index 738a369..60bc3c1 100644 --- a/src/chat/crypto.c +++ b/src/chat/crypto.c @@ -259,13 +259,13 @@ EVP_PKEY* why2_chat_ecc_deserialize_public_key(char *pubkey) return key; } -char *why2_chat_ecc_encrypt(char *message, char *key) +char *why2_chat_ecc_shared_key(char *message, char *ecc_key) { //VARIABLES size_t key_length; char *secret = NULL; size_t secret_len; - char *recipient_pubkey_decoded = base64_decode(key, &key_length); //DECODE key + char *recipient_pubkey_decoded = base64_decode(ecc_key, &key_length); //DECODE key why2_output_flags encrypted; char *encrypted_text; char *returning;