pub struct NoiseTransport { /* private fields */ }Expand description
Post-handshake Noise transport.
Implementations§
Source§impl NoiseTransport
impl NoiseTransport
Sourcepub fn encrypt(&mut self, plaintext: &[u8]) -> Result<Vec<u8>, CryptoError>
pub fn encrypt(&mut self, plaintext: &[u8]) -> Result<Vec<u8>, CryptoError>
Encrypt one plaintext. Up to NOISE_MAX_PLAINTEXT bytes this is a single Noise
message (wire-identical to older peers). Larger plaintexts are split into Noise
messages, each prefixed with its u32 BE length; the result is always longer than
one Noise message can be, so Self::decrypt tells the two forms apart by size.
pub fn decrypt(&mut self, ciphertext: &[u8]) -> Result<Vec<u8>, CryptoError>
Auto Trait Implementations§
impl !RefUnwindSafe for NoiseTransport
impl !UnwindSafe for NoiseTransport
impl Freeze for NoiseTransport
impl Send for NoiseTransport
impl Sync for NoiseTransport
impl Unpin for NoiseTransport
impl UnsafeUnpin for NoiseTransport
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
Mutably borrows from an owned value. Read more