Add des_ede3_cbc cipher
Signed-off-by: Ole Herman Schumacher Elgesem <oleherman93@gmail.com>
This commit is contained in:
parent
eb24a2157a
commit
cc34a7149e
|
|
@ -1889,6 +1889,7 @@ extern "C" {
|
|||
pub fn EVP_des_cbc() -> *const EVP_CIPHER;
|
||||
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_BytesToKey(
|
||||
typ: *const EVP_CIPHER,
|
||||
|
|
|
|||
|
|
@ -137,6 +137,10 @@ impl Cipher {
|
|||
unsafe { Cipher(ffi::EVP_des_ede3()) }
|
||||
}
|
||||
|
||||
pub fn des_ede3_cbc() -> Cipher {
|
||||
unsafe { Cipher(ffi::EVP_des_ede3_cbc()) }
|
||||
}
|
||||
|
||||
pub fn rc4() -> Cipher {
|
||||
unsafe { Cipher(ffi::EVP_rc4()) }
|
||||
}
|
||||
|
|
@ -1050,6 +1054,17 @@ mod tests {
|
|||
cipher_test(super::Cipher::des_ede3(), pt, ct, key, iv);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_des_ede3_cbc() {
|
||||
|
||||
let pt = "54686973206973206120746573742e";
|
||||
let ct = "6f2867cfefda048a4046ef7e556c7132";
|
||||
let key = "7cb66337f3d3c0fe7cb66337f3d3c0fe7cb66337f3d3c0fe";
|
||||
let iv = "0001020304050607";
|
||||
|
||||
cipher_test(super::Cipher::des_ede3_cbc(), pt, ct, key, iv);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_aes128_gcm() {
|
||||
let key = "0e00c76561d2bd9b40c3c15427e2b08f";
|
||||
|
|
|
|||
Loading…
Reference in New Issue