fixed test

This commit is contained in:
Y. T. Chung
2017-02-16 02:08:14 +08:00
parent bf8a463579
commit 7005f4d465
4 changed files with 12 additions and 14 deletions
+9 -9
View File
@@ -341,21 +341,21 @@ impl Display for CipherType {
#[cfg(test)]
mod test_cipher {
use crypto::cipher::{Cipher, CipherType, with_type};
use crypto::{StreamCipher, CipherType, new_stream};
use crypto::CryptoMode;
#[test]
fn test_get_cipher() {
let key = CipherType::Aes128Cfb.bytes_to_key(b"PassWORD");
let iv = CipherType::Aes128Cfb.gen_init_vec();
let mut encryptor = with_type(CipherType::Aes128Cfb,
&key[0..],
&iv[0..],
CryptoMode::Encrypt);
let mut decryptor = with_type(CipherType::Aes128Cfb,
&key[0..],
&iv[0..],
CryptoMode::Decrypt);
let mut encryptor = new_stream(CipherType::Aes128Cfb,
&key[0..],
&iv[0..],
CryptoMode::Encrypt);
let mut decryptor = new_stream(CipherType::Aes128Cfb,
&key[0..],
&iv[0..],
CryptoMode::Decrypt);
let message = "HELLO WORLD";
let mut encrypted_msg = Vec::new();
+1 -1
View File
@@ -157,7 +157,7 @@ impl AeadDecryptor for CryptoAeadCrypto {
#[cfg(test)]
mod test {
use crypto::cipher::{Cipher, CipherType};
use crypto::{StreamCipher, CipherType};
use super::*;
#[test]
+1 -3
View File
@@ -93,10 +93,8 @@ impl OpenSSLCrypto {
/// *Note: This behavior works just the same as the official version of shadowsocks.*
///
/// ```rust
/// use shadowsocks::crypto::CryptoMode;
/// use shadowsocks::crypto::cipher::CipherType;
/// use shadowsocks::crypto::{CryptoMode, StreamCipher, CipherType};
/// use shadowsocks::crypto::openssl::OpenSSLCipher;
/// use shadowsocks::crypto::cipher::Cipher;
///
/// let method = CipherType::Aes128Cfb;
///
+1 -1
View File
@@ -58,7 +58,7 @@ unsafe impl Send for Rc4Md5Cipher {}
#[cfg(test)]
mod test {
use super::*;
use crypto::cipher::{Cipher, CipherType};
use crypto::{StreamCipher, CipherType};
use crypto::CryptoMode;
#[test]