mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-03-27 22:53:07 +00:00
Update SymmetricKey usage
This commit is contained in:
parent
7abd7f1f80
commit
da8fcf8bd6
@ -68,7 +68,7 @@ impl PrivateV1Convo {
|
|||||||
// TODO: Danger - Fix double-ratchets types to Accept SymmetricKey32
|
// TODO: Danger - Fix double-ratchets types to Accept SymmetricKey32
|
||||||
// perhaps update the DH to work with cryptocrate.
|
// perhaps update the DH to work with cryptocrate.
|
||||||
// init_sender doesn't take ownership of the key so a reference can be used.
|
// init_sender doesn't take ownership of the key so a reference can be used.
|
||||||
let shared_secret: [u8; 32] = seed_key.as_bytes().to_vec().try_into().unwrap();
|
let shared_secret: [u8; 32] = seed_key.DANGER_to_bytes();
|
||||||
let dr_state = RatchetState::init_sender(shared_secret, remote);
|
let dr_state = RatchetState::init_sender(shared_secret, remote);
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
|||||||
@ -63,7 +63,7 @@ impl InboxHandshake {
|
|||||||
/// Derive keys from X3DH shared secret
|
/// Derive keys from X3DH shared secret
|
||||||
fn derive_keys_from_shared_secret(shared_secret: SymmetricKey32) -> SymmetricKey32 {
|
fn derive_keys_from_shared_secret(shared_secret: SymmetricKey32) -> SymmetricKey32 {
|
||||||
let seed_key: [u8; 32] = Blake2bMac256::new_with_salt_and_personal(
|
let seed_key: [u8; 32] = Blake2bMac256::new_with_salt_and_personal(
|
||||||
shared_secret.as_slice(),
|
shared_secret.as_bytes(),
|
||||||
&[], // No salt - input already has high entropy
|
&[], // No salt - input already has high entropy
|
||||||
b"InboxV1-Seed",
|
b"InboxV1-Seed",
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user