diff options
| author | Steven Fackler <[email protected]> | 2016-10-25 21:14:28 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-10-25 21:14:28 -0700 |
| commit | a5a3f5579893b6a84a89449e419254e5ba39bcf5 (patch) | |
| tree | b628a3ecd8912aad51f8a601e1389dd54b64fc6e /openssl/src | |
| parent | Merge pull request #490 from sfackler/shutdown (diff) | |
| parent | Support AES GCM (diff) | |
| download | rust-openssl-a5a3f5579893b6a84a89449e419254e5ba39bcf5.tar.xz rust-openssl-a5a3f5579893b6a84a89449e419254e5ba39bcf5.zip | |
Merge pull request #492 from sfackler/gcm
Support AES GCM
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/symm.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/openssl/src/symm.rs b/openssl/src/symm.rs index 65f0addb..bffe337a 100644 --- a/openssl/src/symm.rs +++ b/openssl/src/symm.rs @@ -58,6 +58,12 @@ impl Cipher { } } + pub fn aes_128_gcm() -> Cipher { + unsafe { + Cipher(ffi::EVP_aes_128_gcm()) + } + } + pub fn aes_256_ecb() -> Cipher { unsafe { Cipher(ffi::EVP_aes_256_ecb()) @@ -100,6 +106,12 @@ impl Cipher { } } + pub fn aes_256_gcm() -> Cipher { + unsafe { + Cipher(ffi::EVP_aes_256_gcm()) + } + } + pub fn des_cbc() -> Cipher { unsafe { Cipher(ffi::EVP_des_cbc()) @@ -118,6 +130,10 @@ impl Cipher { } } + pub unsafe fn from_ptr(ptr: *const ffi::EVP_CIPHER) -> Cipher { + Cipher(ptr) + } + pub fn as_ptr(&self) -> *const ffi::EVP_CIPHER { self.0 } |