Skip to content

Commit

Permalink
fix(crypto::stream::chacha20): Fix wrong test case
Browse files Browse the repository at this point in the history
  • Loading branch information
hauleth committed Sep 29, 2015
1 parent 873c4ee commit dd78633
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/crypto/stream/chacha20.rs
Expand Up @@ -147,7 +147,7 @@ impl StreamDecrypt for ChaCha20 {
#[cfg(test)]
mod test {
use super::ChaCha20;
use crypto::stream::StreamEncrypt;
use crypto::stream::{StreamEncrypt, StreamDecrypt};

struct Test<'a> {
key: [u8; 32],
Expand Down Expand Up @@ -221,8 +221,8 @@ mod test {
let mut cipher = ChaCha20::init(&test.key[..], &test.nonce[..], test.position);
let mut buf = vec![0; test.plaintext.len()];

cipher.encrypt_stream(test.plaintext, &mut buf[..]);
assert_eq!(test.ciphertext, &buf[..]);
cipher.decrypt_stream(test.ciphertext, &mut buf[..]);
assert_eq!(test.plaintext, &buf[..]);
}
}
}

0 comments on commit dd78633

Please sign in to comment.