Loading openssl-sys/src/evp.rs +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ extern "C" { pub fn EVP_CIPHER_key_length(cipher: *const EVP_CIPHER) -> c_int; pub fn EVP_CIPHER_block_size(cipher: *const EVP_CIPHER) -> c_int; pub fn EVP_CIPHER_iv_length(cipher: *const EVP_CIPHER) -> c_int; pub fn EVP_CIPHER_nid(cipher: *const EVP_CIPHER) -> c_int; } cfg_if! { Loading openssl/src/symm.rs +10 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,16 @@ impl Cipher { } } /// Returns the cipher's Nid. /// /// This corresponds to [`EVP_CIPHER_nid`] /// /// [`EVP_CIPHER_nid`]: https://www.openssl.org/docs/man1.0.2/crypto/EVP_CIPHER_nid.html pub fn nid(&self) -> Nid { let nid = unsafe { ffi::EVP_CIPHER_nid(self.0) }; Nid::from_raw(nid) } pub fn aes_128_ecb() -> Cipher { unsafe { Cipher(ffi::EVP_aes_128_ecb()) } } Loading Loading
openssl-sys/src/evp.rs +1 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ extern "C" { pub fn EVP_CIPHER_key_length(cipher: *const EVP_CIPHER) -> c_int; pub fn EVP_CIPHER_block_size(cipher: *const EVP_CIPHER) -> c_int; pub fn EVP_CIPHER_iv_length(cipher: *const EVP_CIPHER) -> c_int; pub fn EVP_CIPHER_nid(cipher: *const EVP_CIPHER) -> c_int; } cfg_if! { Loading
openssl/src/symm.rs +10 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,16 @@ impl Cipher { } } /// Returns the cipher's Nid. /// /// This corresponds to [`EVP_CIPHER_nid`] /// /// [`EVP_CIPHER_nid`]: https://www.openssl.org/docs/man1.0.2/crypto/EVP_CIPHER_nid.html pub fn nid(&self) -> Nid { let nid = unsafe { ffi::EVP_CIPHER_nid(self.0) }; Nid::from_raw(nid) } pub fn aes_128_ecb() -> Cipher { unsafe { Cipher(ffi::EVP_aes_128_ecb()) } } Loading