mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-02-10 08:53:08 +00:00
chore: remove crypto for identity
This commit is contained in:
parent
572ae6d954
commit
2e48e49a9a
@ -1,8 +1,7 @@
|
||||
use std::{collections::HashMap, rc::Rc, sync::Arc};
|
||||
|
||||
use crate::{
|
||||
// conversation::{ConversationStore, Convo, Id},
|
||||
conversation::common::{HasConversationId, OutboundSession, SessionRegistry},
|
||||
dm::common::{HasConversationId, OutboundSession, SessionRegistry},
|
||||
errors::ChatError,
|
||||
identity::Identity,
|
||||
inbox::Inbox,
|
||||
@ -122,7 +121,7 @@ impl Context {
|
||||
#[cfg(test)]
|
||||
|
||||
mod tests {
|
||||
use crate::conversation::privatev1::PrivateV1Convo;
|
||||
use crate::dm::privatev1::PrivateV1Convo;
|
||||
|
||||
use super::*;
|
||||
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
use prost::bytes::Bytes;
|
||||
pub use x25519_dalek::{PublicKey, StaticSecret};
|
||||
|
||||
pub trait CopyBytes {
|
||||
fn copy_to_bytes(&self) -> Bytes;
|
||||
}
|
||||
|
||||
impl CopyBytes for PublicKey {
|
||||
fn copy_to_bytes(&self) -> Bytes {
|
||||
Bytes::copy_from_slice(self.as_bytes())
|
||||
}
|
||||
}
|
||||
@ -6,7 +6,7 @@ use crypto::SecretKey;
|
||||
use prost::{Message, bytes::Bytes};
|
||||
|
||||
use crate::{
|
||||
conversation::common::{HasConversationId, OutboundSession, SessionId},
|
||||
dm::common::{HasConversationId, OutboundSession, SessionId},
|
||||
errors::ChatError,
|
||||
types::AddressedEncryptedPayload,
|
||||
utils::timestamp_millis,
|
||||
1
conversations/src/group/mod.rs
Normal file
1
conversations/src/group/mod.rs
Normal file
@ -0,0 +1 @@
|
||||
// Group chat module
|
||||
@ -1,7 +1,6 @@
|
||||
use blake2::{Blake2b512, Digest};
|
||||
use std::fmt;
|
||||
|
||||
use crate::crypto::{PublicKey, StaticSecret};
|
||||
pub use x25519_dalek::{PublicKey, StaticSecret};
|
||||
|
||||
pub struct Identity {
|
||||
secret: StaticSecret,
|
||||
|
||||
@ -5,7 +5,7 @@ use blake2::{
|
||||
use crypto::{DomainSeparator, PrekeyBundle, SecretKey, X3Handshake};
|
||||
use rand_core::{CryptoRng, RngCore};
|
||||
|
||||
use crate::crypto::{PublicKey, StaticSecret};
|
||||
use crate::identity::{PublicKey, StaticSecret};
|
||||
|
||||
type Blake2bMac256 = Blake2bMac<U32>;
|
||||
|
||||
|
||||
@ -8,15 +8,13 @@ use std::rc::Rc;
|
||||
use crypto::{PrekeyBundle, SecretKey};
|
||||
|
||||
use crate::context::Introduction;
|
||||
use crate::conversation::common::{
|
||||
HasConversationId, InboundSessionHandler, OutboundSession, SessionId,
|
||||
};
|
||||
use crate::conversation::privatev1::PrivateV1Convo;
|
||||
use crate::crypto::{CopyBytes, PublicKey, StaticSecret};
|
||||
use crate::dm::common::{HasConversationId, InboundSessionHandler, OutboundSession, SessionId};
|
||||
use crate::dm::privatev1::PrivateV1Convo;
|
||||
use crate::errors::ChatError;
|
||||
use crate::identity::Identity;
|
||||
use crate::identity::{PublicKey, StaticSecret};
|
||||
use crate::inbox::handshake::InboxHandshake;
|
||||
use crate::proto;
|
||||
use crate::proto::{self, CopyBytes};
|
||||
use crate::types::{AddressedEncryptedPayload, ContentData};
|
||||
|
||||
/// Compute the deterministic Delivery_address for an installation
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
mod api;
|
||||
mod context;
|
||||
pub mod conversation;
|
||||
mod crypto;
|
||||
pub mod dm;
|
||||
mod errors;
|
||||
mod group;
|
||||
mod identity;
|
||||
pub mod inbox;
|
||||
mod proto;
|
||||
@ -10,8 +10,6 @@ mod types;
|
||||
mod utils;
|
||||
|
||||
pub use api::*;
|
||||
pub use conversation::common::{HasConversationId, InboundSessionHandler, OutboundSession};
|
||||
pub use inbox::Inbox;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
@ -7,3 +7,14 @@ pub use chat_proto::logoschat::invite::InvitePrivateV1;
|
||||
|
||||
pub use prost::Message;
|
||||
pub use prost::bytes::Bytes;
|
||||
use x25519_dalek::PublicKey;
|
||||
|
||||
pub trait CopyBytes {
|
||||
fn copy_to_bytes(&self) -> Bytes;
|
||||
}
|
||||
|
||||
impl CopyBytes for PublicKey {
|
||||
fn copy_to_bytes(&self) -> Bytes {
|
||||
Bytes::copy_from_slice(self.as_bytes())
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user