Add AES-192 and OFB mode

This commit is contained in:
Leo 2019-07-06 17:11:37 +08:00
parent 01fc84f5e0
commit 88c5bd81c7
2 changed files with 55 additions and 0 deletions

View File

@ -224,6 +224,16 @@ extern "C" {
pub fn EVP_aes_128_ccm() -> *const EVP_CIPHER; pub fn EVP_aes_128_ccm() -> *const EVP_CIPHER;
pub fn EVP_aes_128_gcm() -> *const EVP_CIPHER; pub fn EVP_aes_128_gcm() -> *const EVP_CIPHER;
pub fn EVP_aes_128_xts() -> *const EVP_CIPHER; pub fn EVP_aes_128_xts() -> *const EVP_CIPHER;
pub fn EVP_aes_128_ofb() -> *const EVP_CIPHER;
pub fn EVP_aes_192_ecb() -> *const EVP_CIPHER;
pub fn EVP_aes_192_cbc() -> *const EVP_CIPHER;
pub fn EVP_aes_192_cfb1() -> *const EVP_CIPHER;
pub fn EVP_aes_192_cfb8() -> *const EVP_CIPHER;
pub fn EVP_aes_192_cfb128() -> *const EVP_CIPHER;
pub fn EVP_aes_192_ctr() -> *const EVP_CIPHER;
pub fn EVP_aes_192_ccm() -> *const EVP_CIPHER;
pub fn EVP_aes_192_gcm() -> *const EVP_CIPHER;
pub fn EVP_aes_192_ofb() -> *const EVP_CIPHER;
pub fn EVP_aes_256_ecb() -> *const EVP_CIPHER; pub fn EVP_aes_256_ecb() -> *const EVP_CIPHER;
pub fn EVP_aes_256_cbc() -> *const EVP_CIPHER; pub fn EVP_aes_256_cbc() -> *const EVP_CIPHER;
pub fn EVP_aes_256_cfb1() -> *const EVP_CIPHER; pub fn EVP_aes_256_cfb1() -> *const EVP_CIPHER;
@ -233,6 +243,7 @@ extern "C" {
pub fn EVP_aes_256_ccm() -> *const EVP_CIPHER; pub fn EVP_aes_256_ccm() -> *const EVP_CIPHER;
pub fn EVP_aes_256_gcm() -> *const EVP_CIPHER; pub fn EVP_aes_256_gcm() -> *const EVP_CIPHER;
pub fn EVP_aes_256_xts() -> *const EVP_CIPHER; pub fn EVP_aes_256_xts() -> *const EVP_CIPHER;
pub fn EVP_aes_256_ofb() -> *const EVP_CIPHER;
#[cfg(ossl110)] #[cfg(ossl110)]
pub fn EVP_chacha20() -> *const ::EVP_CIPHER; pub fn EVP_chacha20() -> *const ::EVP_CIPHER;
#[cfg(ossl110)] #[cfg(ossl110)]

View File

@ -126,6 +126,46 @@ impl Cipher {
unsafe { Cipher(ffi::EVP_aes_128_ccm()) } unsafe { Cipher(ffi::EVP_aes_128_ccm()) }
} }
pub fn aes_128_ofb() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_128_ofb()) }
}
pub fn aes_192_ecb() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_192_ecb()) }
}
pub fn aes_192_cbc() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_192_cbc()) }
}
pub fn aes_192_ctr() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_192_ctr()) }
}
pub fn aes_192_cfb1() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_192_cfb1()) }
}
pub fn aes_192_cfb128() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_192_cfb128()) }
}
pub fn aes_192_cfb8() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_192_cfb8()) }
}
pub fn aes_192_gcm() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_192_gcm()) }
}
pub fn aes_192_ccm() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_192_ccm()) }
}
pub fn aes_192_ofb() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_192_ofb()) }
}
pub fn aes_256_ecb() -> Cipher { pub fn aes_256_ecb() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_256_ecb()) } unsafe { Cipher(ffi::EVP_aes_256_ecb()) }
} }
@ -162,6 +202,10 @@ impl Cipher {
unsafe { Cipher(ffi::EVP_aes_256_ccm()) } unsafe { Cipher(ffi::EVP_aes_256_ccm()) }
} }
pub fn aes_256_ofb() -> Cipher {
unsafe { Cipher(ffi::EVP_aes_256_ofb()) }
}
pub fn bf_cbc() -> Cipher { pub fn bf_cbc() -> Cipher {
unsafe { Cipher(ffi::EVP_bf_cbc()) } unsafe { Cipher(ffi::EVP_bf_cbc()) }
} }