Skip to content

Commit

Permalink
Add des_ede3_cfb symm cipher
Browse files Browse the repository at this point in the history
  • Loading branch information
okuryu committed Feb 17, 2019
1 parent 3a170b6 commit 941a69a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions openssl-sys/src/evp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ extern "C" {
pub fn EVP_des_ecb() -> *const EVP_CIPHER;
pub fn EVP_des_ede3() -> *const EVP_CIPHER;
pub fn EVP_des_ede3_cbc() -> *const EVP_CIPHER;
pub fn EVP_des_ede3_cfb() -> *const EVP_CIPHER;
pub fn EVP_des_cbc() -> *const EVP_CIPHER;
pub fn EVP_rc4() -> *const EVP_CIPHER;
pub fn EVP_bf_ecb() -> *const EVP_CIPHER;
Expand Down
14 changes: 14 additions & 0 deletions openssl/src/symm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ impl Cipher {
unsafe { Cipher(ffi::EVP_des_ede3_cbc()) }
}

pub fn des_ede3_cfb() -> Cipher {
unsafe { Cipher(ffi::EVP_des_ede3_cfb()) }
}

pub fn rc4() -> Cipher {
unsafe { Cipher(ffi::EVP_rc4()) }
}
Expand Down Expand Up @@ -1055,6 +1059,16 @@ mod tests {
cipher_test(super::Cipher::des_ede3_cbc(), pt, ct, key, iv);
}

#[test]
fn test_des_ede3_cfb() {
let pt = "2b1773784b5889dc788477367daa98ad";
let ct = "6f2867cfefda048a4046ef7e556c7132";
let key = "7cb66337f3d3c0fe7cb66337f3d3c0fe7cb66337f3d3c0fe";
let iv = "0001020304050607";

cipher_test(super::Cipher::des_ede3_cfb(), pt, ct, key, iv);
}

#[test]
fn test_aes128_gcm() {
let key = "0e00c76561d2bd9b40c3c15427e2b08f";
Expand Down

0 comments on commit 941a69a

Please sign in to comment.