pub struct ECIES { /* private fields */ }
Implementations§
Source§impl ECIES
impl ECIES
Sourcepub fn new_client(
secret_key: SecretKey,
remote_id: PeerId,
) -> Result<Self, ECIESError>
pub fn new_client( secret_key: SecretKey, remote_id: PeerId, ) -> Result<Self, ECIESError>
Create a new ECIES client with the given static secret key and remote peer ID.
Sourcepub fn new_static_server(
secret_key: SecretKey,
nonce: B256,
ephemeral_secret_key: SecretKey,
) -> Result<Self, ECIESError>
pub fn new_static_server( secret_key: SecretKey, nonce: B256, ephemeral_secret_key: SecretKey, ) -> Result<Self, ECIESError>
Create a new server with the given static secret key, remote peer id, and ephemeral secret key.
Sourcepub fn new_server(secret_key: SecretKey) -> Result<Self, ECIESError>
pub fn new_server(secret_key: SecretKey) -> Result<Self, ECIESError>
Create a new ECIES server with the given static secret key.
Sourcepub fn write_auth(&mut self, buf: &mut BytesMut)
pub fn write_auth(&mut self, buf: &mut BytesMut)
Write an auth message to the given buffer.
Sourcepub fn read_auth(&mut self, data: &mut [u8]) -> Result<(), ECIESError>
pub fn read_auth(&mut self, data: &mut [u8]) -> Result<(), ECIESError>
Read and verify an auth message from the input data.
Sourcepub fn read_ack(&mut self, data: &mut [u8]) -> Result<(), ECIESError>
pub fn read_ack(&mut self, data: &mut [u8]) -> Result<(), ECIESError>
Read and verify an ack message from the input data.
pub fn write_header(&mut self, out: &mut BytesMut, size: usize)
Sourcepub fn read_header(&mut self, data: &mut [u8]) -> Result<usize, ECIESError>
pub fn read_header(&mut self, data: &mut [u8]) -> Result<usize, ECIESError>
Reads the RLPx
header from the slice, setting up the MAC and AES, returning the body
size contained in the header.
pub const fn header_len() -> usize
pub fn body_len(&self) -> usize
pub fn write_body(&mut self, out: &mut BytesMut, data: &[u8])
pub fn read_body<'a>( &mut self, data: &'a mut [u8], ) -> Result<&'a mut [u8], ECIESError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ECIES
impl RefUnwindSafe for ECIES
impl Send for ECIES
impl Sync for ECIES
impl Unpin for ECIES
impl UnwindSafe for ECIES
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 3440 bytes