pub fn encrypt(self, src: &[u8], key: &[u8], iv: &[u8]) -> OsshResult<Vec<u8>> {
        use Cipher::*;
        match self {
            Aes128_Cbc => aes128cbc_encrypt(src, key, iv),
            Aes192_Cbc => aes192cbc_encrypt(src, key, iv),
            Aes256_Cbc => aes256cbc_encrypt(src, key, iv),
            Aes128_Ctr => aes128ctr_encrypt(src, key, iv),
            Aes192_Ctr => aes192ctr_encrypt(src, key, iv),
            Aes256_Ctr => aes256ctr_encrypt(src, key, iv),
            TDes_Cbc => tdescbc_encrypt(src, key, iv),
            Null => Ok(src.to_vec()),
        }
    }
/// Encrypt the data
///
/// Mostly used by the internal codes.
/// Usually you don't need to call it directly.
Encrypt the data
Mostly used by the internal codes.
Usually you don't need to call it directly.
Encrypt the data Mostly used by the internal codes . Usually you don ' t need to call it directly .
pub fn encrypt(self, src: &[u8], key: &[u8], iv: &[u8]) -> OsshResult<Vec<u8>> {
        use Cipher::*;
        match self {
            Aes128_Cbc => aes128cbc_encrypt(src, key, iv),
            Aes192_Cbc => aes192cbc_encrypt(src, key, iv),
            Aes256_Cbc => aes256cbc_encrypt(src, key, iv),
            Aes128_Ctr => aes128ctr_encrypt(src, key, iv),
            Aes192_Ctr => aes192ctr_encrypt(src, key, iv),
            Aes256_Ctr => aes256ctr_encrypt(src, key, iv),
            TDes_Cbc => tdescbc_encrypt(src, key, iv),
            Null => Ok(src.to_vec()),
        }
    }
pub fn encrypt ( self , src : & [ u8 ] , key : & [ u8 ] , iv : & [ u8 ] ) -> OsshResult < Vec < u8 > > { use Cipher :: * ; match self { Aes128_Cbc => aes128cbc_encrypt ( src , key , iv ) , Aes192_Cbc => aes192cbc_encrypt ( src , key , iv ) , Aes256_Cbc => aes256cbc_encrypt ( src , key , iv ) , Aes128_Ctr => aes128ctr_encrypt ( src , key , iv ) , Aes192_Ctr => aes192ctr_encrypt ( src , key , iv ) , Aes256_Ctr => aes256ctr_encrypt ( src , key , iv ) , TDes_Cbc => tdescbc_encrypt ( src , key , iv ) , Null => Ok ( src . to_vec ( ) ) , } }
Encrypt the data
Mostly used by the internal codes.
Encrypt the data Mostly used by the internal codes .
self
src
&[u8]
key
&[u8]
iv
&[u8]
self
src
&[u8]
key
&[u8]
iv
&[u8]