[−][src]Struct yaca::EncryptContext
Context for Encrypt
operations
Implementations
impl EncryptContext
[src]
pub fn get_iv_length(
algo: &EncryptAlgorithm,
bcm: &BlockCipherMode,
key_length: &KeyLength
) -> Result<Option<KeyLength>>
[src]
algo: &EncryptAlgorithm,
bcm: &BlockCipherMode,
key_length: &KeyLength
) -> Result<Option<KeyLength>>
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]
algo: &EncryptAlgorithm,
bcm: &BlockCipherMode,
sym_key: &Key,
iv: Option<&Key>
) -> Result<EncryptContext>
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, seeEncryptContext::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]
fn set_property_padding(&self, padding: &Padding) -> Result<()>
[src]
impl ContextWithRc2Supported for EncryptContext
[src]
fn set_property_rc2_effective_key_bits(
&self,
rc2_eff_key_bits: usize
) -> Result<()>
[src]
&self,
rc2_eff_key_bits: usize
) -> Result<()>
impl ContextWithXcmEncryptProperties for EncryptContext
[src]
fn set_property_ccm_aad(
&self,
ccm_aad: &[u8],
plaintext_len: usize
) -> Result<()>
[src]
&self,
ccm_aad: &[u8],
plaintext_len: usize
) -> Result<()>
fn set_property_gcm_tag_len(&self, gcm_tag_len: usize) -> Result<()>
[src]
fn get_property_gcm_tag(&self) -> Result<Vec<u8>>
[src]
fn set_property_gcm_aad(&self, gcm_aad: &[u8]) -> Result<()>
[src]
fn set_property_ccm_tag_len(&self, ccm_tag_len: usize) -> Result<()>
[src]
fn get_property_ccm_tag(&self) -> Result<Vec<u8>>
[src]
impl Drop for EncryptContext
[src]
Auto Trait Implementations
impl RefUnwindSafe for EncryptContext
impl !Send for EncryptContext
impl !Sync for EncryptContext
impl Unpin for EncryptContext
impl UnwindSafe for EncryptContext
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,