mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-02-18 12:23:19 +00:00
replace serilization in key_management ephm key holder
This commit is contained in:
parent
2f3a6ab921
commit
59e6ee8240
@ -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();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user