aboutsummaryrefslogtreecommitdiffstats
path: root/src/packet.rs
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2026-03-28 22:35:26 +0000
committers-ol <s+removethis@s-ol.nu>2026-03-28 22:38:32 +0000
commitb4bb62b7ca0be710a0a7d5484cb9d3371f24ec2a (patch)
tree2cb6178dfa67f52f9be5bd7844969ca92e8cb4f8 /src/packet.rs
parentexpose more fields (diff)
downloadmeshcore-rs-dumb-no-std.tar.gz
meshcore-rs-dumb-no-std.zip
no-std compatible cryptodumb-no-std
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),