diff --git a/README.md b/README.md index 970ec551..224354be 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,13 @@ let ciphertext = hex!("e405626e 4f1236b3 670ee428 332ea20e"); // Here we use the `Into` trait to convert arrays into it. let mut cipher = ChaCha20::new(&key.into(), &nonce.into()); -let mut buffer = plaintext.clone(); +let mut buffer = plaintext; // apply keystream (encrypt) cipher.apply_keystream(&mut buffer); assert_eq!(buffer, ciphertext); -let ciphertext = buffer.clone(); +let ciphertext = buffer; // ChaCha ciphers support seeking cipher.seek(0u32); diff --git a/chacha20/src/lib.rs b/chacha20/src/lib.rs index a086a01b..f3e47ae0 100644 --- a/chacha20/src/lib.rs +++ b/chacha20/src/lib.rs @@ -40,13 +40,13 @@ //! // Here we use the `Into` trait to convert arrays into it. //! let mut cipher = ChaCha20::new(&key.into(), &nonce.into()); //! -//! let mut buffer = plaintext.clone(); +//! let mut buffer = plaintext; //! //! // apply keystream (encrypt) //! cipher.apply_keystream(&mut buffer); //! assert_eq!(buffer, ciphertext); //! -//! let ciphertext = buffer.clone(); +//! let ciphertext = buffer; //! //! // ChaCha ciphers support seeking //! cipher.seek(0u32); diff --git a/hc-256/src/lib.rs b/hc-256/src/lib.rs index fb85ae26..2365a90e 100644 --- a/hc-256/src/lib.rs +++ b/hc-256/src/lib.rs @@ -25,13 +25,13 @@ //! // Here we use the `Into` trait to convert arrays into it. //! let mut cipher = Hc256::new(&key.into(), &nonce.into()); //! -//! let mut buffer = plaintext.clone(); +//! let mut buffer = plaintext; //! //! // apply keystream (encrypt) //! cipher.apply_keystream(&mut buffer); //! assert_eq!(buffer, ciphertext); //! -//! let ciphertext = buffer.clone(); +//! let ciphertext = buffer; //! //! // decrypt ciphertext by applying keystream again //! let mut cipher = Hc256::new(&key.into(), &nonce.into()); diff --git a/rabbit/src/lib.rs b/rabbit/src/lib.rs index 677b7ac4..c92fe04b 100644 --- a/rabbit/src/lib.rs +++ b/rabbit/src/lib.rs @@ -25,13 +25,13 @@ //! // Here we use the `Into` trait to convert arrays into it. //! let mut cipher = Rabbit::new(&key.into(), &nonce.into()); //! -//! let mut buffer = plaintext.clone(); +//! let mut buffer = plaintext; //! //! // apply keystream (encrypt) //! cipher.apply_keystream(&mut buffer); //! assert_eq!(buffer, ciphertext); //! -//! let ciphertext = buffer.clone(); +//! let ciphertext = buffer; //! //! // decrypt ciphertext by applying keystream again //! let mut cipher = Rabbit::new(&key.into(), &nonce.into()); diff --git a/salsa20/src/lib.rs b/salsa20/src/lib.rs index a5407c73..856afc82 100644 --- a/salsa20/src/lib.rs +++ b/salsa20/src/lib.rs @@ -38,13 +38,13 @@ //! // Here we use the `Into` trait to convert arrays into it. //! let mut cipher = Salsa20::new(&key.into(), &nonce.into()); //! -//! let mut buffer = plaintext.clone(); +//! let mut buffer = plaintext; //! //! // apply keystream (encrypt) //! cipher.apply_keystream(&mut buffer); //! assert_eq!(buffer, ciphertext); //! -//! let ciphertext = buffer.clone(); +//! let ciphertext = buffer; //! //! // Salsa ciphers support seeking //! cipher.seek(0u32);