reth_ecies/
lib.rs

1//! `RLPx` ECIES framed transport protocol.
2
3#![doc(
4    html_logo_url = "https://raw.githubusercontent.com/paradigmxyz/reth/main/assets/reth-docs.png",
5    html_favicon_url = "https://avatars0.githubusercontent.com/u/97369466?s=256",
6    issue_tracker_base_url = "https://github.com/paradigmxyz/reth/issues/"
7)]
8#![cfg_attr(not(test), warn(unused_crate_dependencies))]
9#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
10
11pub mod algorithm;
12pub mod mac;
13pub mod stream;
14pub mod util;
15
16mod error;
17pub use error::{ECIESError, ECIESErrorImpl};
18
19pub mod codec;
20
21use alloy_primitives::{
22    bytes::{Bytes, BytesMut},
23    B512 as PeerId,
24};
25
26/// Raw egress values for an ECIES protocol
27#[derive(Clone, Debug, PartialEq, Eq)]
28pub enum EgressECIESValue {
29    /// The AUTH message being sent out
30    Auth,
31    /// The ACK message being sent out
32    Ack,
33    /// The message being sent out (wrapped bytes)
34    Message(Bytes),
35}
36
37/// Raw ingress values for an ECIES protocol
38#[derive(Clone, Debug, PartialEq, Eq)]
39pub enum IngressECIESValue {
40    /// Receiving a message from a [`PeerId`]
41    AuthReceive(PeerId),
42    /// Receiving an ACK message
43    Ack,
44    /// Receiving a message
45    Message(BytesMut),
46}