[][src]Struct yaca::EncryptContext

pub struct EncryptContext { /* fields omitted */ }

Context for Encrypt operations

Implementations

impl EncryptContext[src]

pub fn get_iv_length(
    algo: &EncryptAlgorithm,
    bcm: &BlockCipherMode,
    key_length: &KeyLength
) -> Result<Option<KeyLength>>
[src]

Returns the recommended/default length of the Initialization Vector for a given encryption configuration

  • If None returned that means that for this specific algorithm and its parameters Initialization Vector is not used.

pub fn initialize(
    algo: &EncryptAlgorithm,
    bcm: &BlockCipherMode,
    sym_key: &Key,
    iv: Option<&Key>
) -> Result<EncryptContext>
[src]

Initializes an encryption context

  • algo is an encryption algorithm used to encrypt the data.
  • bcm is a chaining mode used to encrypt the data.
  • sym_key is a symmetric key used to encrypt the data.
  • iv is an optional Initialization Vector used to encrypt the data, see EncryptContext::get_iv_length()

pub fn update(&self, plaintext: &[u8]) -> Result<Vec<u8>>[src]

Encrypts chunk of the data

  • plaintext is a chunk of data to be encrypted.
  • Returns a chunk of encrypted data.

pub fn finalize(&self) -> Result<Vec<u8>>[src]

Encrypts the final chunk of the data

  • Returns the final chunk of encrypted data.

Trait Implementations

impl ContextWithPadding for EncryptContext[src]

impl ContextWithRc2Supported for EncryptContext[src]

impl ContextWithXcmEncryptProperties for EncryptContext[src]

impl Drop for EncryptContext[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.