[][src]Struct ffsend_api::pipe::crypto::ece::EceCrypt

pub struct EceCrypt { /* fields omitted */ }

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]

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 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

impl Send for EceCrypt

impl Sync for EceCrypt

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

default fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> Same for T

type Output = T

Should always be Self