[−][src]Struct ffsend_api::pipe::crypto::ece::EceCrypt
Something that can encrypt or decrypt given data using ECE.
Methods
impl EceCrypt
[src]
pub fn new(
mode: CryptMode,
len: usize,
ikm: Vec<u8>,
salt: Option<Vec<u8>>
) -> Self
[src]
mode: CryptMode,
len: usize,
ikm: Vec<u8>,
salt: Option<Vec<u8>>
) -> Self
Construct a new ECE crypter pipe.
It is highly recommended to use the encrypt()
and
decrypt()
methods instead for constructing a new crypter.
The size in bytes of the plaintext data must be given as len
.
The input key material must be given as ikm
.
When encrypting, a salt
must be specified.
pub fn encrypt(len: usize, ikm: Vec<u8>, salt: Option<Vec<u8>>) -> Self
[src]
Create an ECE encryptor.
The size in bytes of the plaintext data that is encrypted decrypt must be given as len
.
The input key material must be given as ikm
.
The salt
is optional and will be randomly generated if None
.
pub fn decrypt(len: usize, ikm: Vec<u8>) -> Self
[src]
Create an ECE decryptor.
The size in bytes of the plaintext data that is decrypted decrypt must be given as len
.
The input key material must be given as ikm
.
Trait Implementations
impl Crypt for EceCrypt
[src]
fn crypt(&mut self, input: &[u8]) -> (usize, Option<Vec<u8>>)
[src]
Encrypt/decrypt bytes from input
, return the result. Read more
impl Pipe for EceCrypt
[src]
type Reader = EceReader
The wrapping reader type used for this pipe.
type Writer = EceWriter
The wrapping writer type used for this pipe.
fn pipe(&mut self, input: &[u8]) -> (usize, Option<Vec<u8>>)
[src]
fn reader(self, inner: Box<dyn Read>) -> Self::Reader
[src]
Wrap the inner
reader, bytes that are read are transformed through this pipe.
fn writer(self, inner: Box<dyn Write>) -> Self::Writer
[src]
Wrap the inner
writer, bytes that are read are transformed through this pipe.
fn pipe_transparent(&self, input: &[u8]) -> (usize, Option<Vec<u8>>)
[src]
Transparently pipe input
by immediately returning it. Read more
impl PipeRead<EceCrypt> for EceReader
[src]
impl PipeWrite<EceCrypt> for EceWriter
[src]
impl PipeLen for EceCrypt
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> Same for T
type Output = T
Should always be Self