Clean up warnings

This commit is contained in:
Jazz Turner-Baggs 2026-02-06 13:34:31 -08:00
parent fc343ff82e
commit 98c74a120e
No known key found for this signature in database
3 changed files with 3 additions and 13 deletions

View File

@ -24,8 +24,6 @@ pub enum ChatError {
#[derive(Error, Debug)] #[derive(Error, Debug)]
pub enum EncryptionError { pub enum EncryptionError {
#[error("encryption: {0}")]
Encryption(String),
#[error("decryption: {0}")] #[error("decryption: {0}")]
Decryption(String), Decryption(String),
} }

View File

@ -1,4 +1,3 @@
use blake2::{Blake2b512, Digest};
use std::fmt; use std::fmt;
use crate::crypto::{PublicKey, StaticSecret}; use crate::crypto::{PublicKey, StaticSecret};
@ -23,10 +22,6 @@ impl Identity {
} }
} }
pub fn address(&self) -> String {
hex::encode(Blake2b512::digest(self.public_key()))
}
pub fn public_key(&self) -> PublicKey { pub fn public_key(&self) -> PublicKey {
PublicKey::from(&self.secret) PublicKey::from(&self.secret)
} }

View File

@ -187,7 +187,7 @@ impl Inbox {
); );
// TODO: Decrypt Content // TODO: Decrypt Content
let frame = proto::InboxV1Frame::decode(bytes)?; let frame = self.decrypt_frame(bytes)?;
Ok((seed_key, frame)) Ok((seed_key, frame))
} }
@ -203,12 +203,9 @@ impl Inbox {
Ok(handshake) Ok(handshake)
} }
fn decrypt_frame( fn decrypt_frame(&self, enc_frame_bytes: Bytes) -> Result<proto::InboxV1Frame, ChatError> {
enc_payload: proto::InboxHandshakeV1,
) -> Result<proto::InboxV1Frame, ChatError> {
let frame_bytes = enc_payload.payload;
// TODO: decrypt payload // TODO: decrypt payload
let frame = proto::InboxV1Frame::decode(frame_bytes)?; let frame = proto::InboxV1Frame::decode(enc_frame_bytes)?;
Ok(frame) Ok(frame)
} }