Loading crypto/symm.rs +3 −3 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ impl Crypter { /** * Initializes this crypter. */ pub fn init(&self, mode: Mode, key: &[u8], iv: &[u8]) { pub fn init(&self, mode: Mode, key: &[u8], iv: Vec<u8>) { unsafe { let mode = match mode { Encrypt => 1 as c_int, Loading Loading @@ -171,7 +171,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: Type, key: &[u8], iv: ~[u8], data: &[u8]) -> Vec<u8> { pub fn encrypt(t: Type, key: &[u8], iv: Vec<u8>, data: &[u8]) -> Vec<u8> { let c = Crypter::new(t); c.init(Encrypt, key, iv); let r = c.update(data); Loading @@ -183,7 +183,7 @@ pub fn encrypt(t: Type, key: &[u8], iv: ~[u8], data: &[u8]) -> Vec<u8> { * 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: Type, key: &[u8], iv: ~[u8], data: &[u8]) -> Vec<u8> { pub fn decrypt(t: Type, key: &[u8], iv: Vec<u8>, data: &[u8]) -> Vec<u8> { let c = Crypter::new(t); c.init(Decrypt, key, iv); let r = c.update(data); Loading Loading
crypto/symm.rs +3 −3 Original line number Diff line number Diff line Loading @@ -101,7 +101,7 @@ impl Crypter { /** * Initializes this crypter. */ pub fn init(&self, mode: Mode, key: &[u8], iv: &[u8]) { pub fn init(&self, mode: Mode, key: &[u8], iv: Vec<u8>) { unsafe { let mode = match mode { Encrypt => 1 as c_int, Loading Loading @@ -171,7 +171,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: Type, key: &[u8], iv: ~[u8], data: &[u8]) -> Vec<u8> { pub fn encrypt(t: Type, key: &[u8], iv: Vec<u8>, data: &[u8]) -> Vec<u8> { let c = Crypter::new(t); c.init(Encrypt, key, iv); let r = c.update(data); Loading @@ -183,7 +183,7 @@ pub fn encrypt(t: Type, key: &[u8], iv: ~[u8], data: &[u8]) -> Vec<u8> { * 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: Type, key: &[u8], iv: ~[u8], data: &[u8]) -> Vec<u8> { pub fn decrypt(t: Type, key: &[u8], iv: Vec<u8>, data: &[u8]) -> Vec<u8> { let c = Crypter::new(t); c.init(Decrypt, key, iv); let r = c.update(data); Loading