feat(client): redesign native UI, themes, settings and avatars
Separate conversation drafts and voice view state, add native settings and restricted CSS themes, implement validated avatar cropping, and refresh dependencies with documented desktop compatibility backports.
This commit is contained in:
parent
44d284a568
commit
8e5ab56611
276 changed files with 53546 additions and 3399 deletions
|
|
@ -30,14 +30,14 @@ pub fn compute_shared_secret(my_secret: &StaticSecret, peer_public_bytes: &[u8])
|
|||
pub fn encrypt_message(msg_key: &[u8; 32], message_id: &str, plaintext: &str) -> Vec<u8> {
|
||||
let cipher = ChaCha20Poly1305::new_from_slice(msg_key).unwrap();
|
||||
let hash = Sha256::digest(message_id.as_bytes());
|
||||
let nonce = Nonce::from_slice(&hash[..12]);
|
||||
cipher.encrypt(nonce, plaintext.as_bytes()).unwrap()
|
||||
let nonce = Nonce::from(<[u8; 12]>::try_from(&hash[..12]).expect("fixed nonce length"));
|
||||
cipher.encrypt(&nonce, plaintext.as_bytes()).unwrap()
|
||||
}
|
||||
|
||||
pub fn decrypt_message(msg_key: &[u8; 32], message_id: &str, ciphertext: &[u8]) -> String {
|
||||
let cipher = ChaCha20Poly1305::new_from_slice(msg_key).unwrap();
|
||||
let hash = Sha256::digest(message_id.as_bytes());
|
||||
let nonce = Nonce::from_slice(&hash[..12]);
|
||||
let plaintext = cipher.decrypt(nonce, ciphertext).unwrap();
|
||||
let nonce = Nonce::from(<[u8; 12]>::try_from(&hash[..12]).expect("fixed nonce length"));
|
||||
let plaintext = cipher.decrypt(&nonce, ciphertext).unwrap();
|
||||
String::from_utf8(plaintext).unwrap()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue