diff options
| author | Steven Fackler <[email protected]> | 2015-06-16 21:56:44 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-11-16 20:16:01 -0800 |
| commit | b0cb0f7c40ad58fab493c7a40af1f0dcf4864d71 (patch) | |
| tree | 482996423598e8a1d964f168b4473a4613768262 /openssl/src | |
| parent | Merge pull request #300 from thommay/pkey_private_encrypt (diff) | |
| download | rust-openssl-b0cb0f7c40ad58fab493c7a40af1f0dcf4864d71.tar.xz rust-openssl-b0cb0f7c40ad58fab493c7a40af1f0dcf4864d71.zip | |
Revert "Use AsRef for backwards compatibility with passing IV as Vec"
This reverts commit d2d20a83778b7c363322997332bf1ff5deef92d5.
Diffstat (limited to 'openssl/src')
| -rw-r--r-- | openssl/src/crypto/symm.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/openssl/src/crypto/symm.rs b/openssl/src/crypto/symm.rs index db8aa54e..bc4b65b5 100644 --- a/openssl/src/crypto/symm.rs +++ b/openssl/src/crypto/symm.rs @@ -1,5 +1,4 @@ use std::iter::repeat; -use std::convert::AsRef; use libc::{c_int}; use crypto::symm_internal::evpc; @@ -75,7 +74,7 @@ impl Crypter { /** * Initializes this crypter. */ - pub fn init<T: AsRef<[u8]>>(&self, mode: Mode, key: &[u8], iv: T) { + pub fn init(&self, mode: Mode, key: &[u8], iv: &[u8]) { unsafe { let mode = match mode { Mode::Encrypt => 1 as c_int, @@ -87,7 +86,7 @@ impl Crypter { self.ctx, self.evp, key.as_ptr(), - iv.as_ref().as_ptr(), + iv.as_ptr(), mode ); } @@ -146,7 +145,7 @@ impl Drop for Crypter { * Encrypts data, using the specified crypter type in encrypt mode with the * specified key and iv; returns the resulting (encrypted) data. */ -pub fn encrypt<T: AsRef<[u8]>>(t: Type, key: &[u8], iv: T, data: &[u8]) -> Vec<u8> { +pub fn encrypt(t: Type, key: &[u8], iv: &[u8], data: &[u8]) -> Vec<u8> { let c = Crypter::new(t); c.init(Mode::Encrypt, key, iv); let mut r = c.update(data); @@ -159,7 +158,7 @@ pub fn encrypt<T: AsRef<[u8]>>(t: Type, key: &[u8], iv: T, data: &[u8]) -> Vec<u * Decrypts data, using the specified crypter type in decrypt mode with the * specified key and iv; returns the resulting (decrypted) data. */ -pub fn decrypt<T: AsRef<[u8]>>(t: Type, key: &[u8], iv: T, data: &[u8]) -> Vec<u8> { +pub fn decrypt(t: Type, key: &[u8], iv: &[u8], data: &[u8]) -> Vec<u8> { let c = Crypter::new(t); c.init(Mode::Decrypt, key, iv); let mut r = c.update(data); |