replace serilization in key_management ephm key holder

This commit is contained in:
Rostyslav Tyshko 2025-04-04 14:56:30 -04:00
parent 2f3a6ab921
commit 59e6ee8240

View File

@ -1,5 +1,4 @@
use aes_gcm::{aead::Aead, AeadCore, Aes256Gcm, Key, KeyInit};
use elliptic_curve::group::GroupEncoding;
use elliptic_curve::PrimeField;
use k256::{AffinePoint, FieldBytes, Scalar};
use log::info;
@ -41,7 +40,7 @@ impl EphemeralKeyHolder {
data: &[u8],
) -> (CipherText, Nonce) {
let key_point = self.calculate_shared_secret_sender(viewing_public_key_receiver);
let binding = key_point.to_bytes();
let binding = serde_json::to_vec(&key_point).unwrap();
let key_raw = &binding.as_slice()[..32];
let key_raw_adjust: [u8; 32] = key_raw.try_into().unwrap();