aboutsummaryrefslogtreecommitdiffstats
path: root/src/packet.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/packet.rs')
-rw-r--r--src/packet.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/packet.rs b/src/packet.rs
index 86537a7..b1be782 100644
--- a/src/packet.rs
+++ b/src/packet.rs
@@ -1,12 +1,11 @@
-#[cfg(feature = "std")]
-use crate::std_identity::Keystore;
-
+extern crate alloc;
+use alloc::borrow::ToOwned;
use bytes::{Buf, Bytes};
use tinyvec::ArrayVec;
+use crate::crypto::Keystore;
use crate::packet_content::PacketContent;
-#[cfg(feature = "std")]
use crate::{
anon_req::ClearAnonRequest, request::ClearRequest, response::ClearResponse, text::ClearText,
};
@@ -201,8 +200,7 @@ impl core::fmt::Display for Packet {
}
impl Packet {
- #[cfg(feature = "std")]
- pub fn try_decrypt(&mut self, keystore: &Keystore) -> bool {
+ pub fn try_decrypt<T: Keystore>(&mut self, keystore: &T) -> bool {
match self.content {
// Encrypted packet types
PacketContent::Path(ref mut path) => path.cipher.try_decrypt(keystore),