Clean up warnings

This commit is contained in:
Jazz Turner-Baggs 2026-02-06 13:34:31 -08:00
parent 0b31a15b6a
commit 418dee1846
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)]
pub enum EncryptionError {
#[error("encryption: {0}")]
Encryption(String),
#[error("decryption: {0}")]
Decryption(String),
}

View File

@ -1,4 +1,3 @@
use blake2::{Blake2b512, Digest};
use std::fmt;
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 {
PublicKey::from(&self.secret)
}

View File

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