mirror of
https://github.com/shadowsocks/shadowsocks-rust.git
synced 2026-11-14 08:14:45 +00:00
fixed test
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -157,7 +157,7 @@ impl AeadDecryptor for CryptoAeadCrypto {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crypto::cipher::{Cipher, CipherType};
|
||||
use crypto::{StreamCipher, CipherType};
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -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;
|
||||
///
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user