File tree Expand file tree Collapse file tree 6 files changed +7
-7
lines changed
Expand file tree Collapse file tree 6 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 6565//! // Initialize cipher
6666//! let cipher = Aes128::new(&key);
6767//!
68- //! let block_copy = block.clone() ;
68+ //! let block_copy = block;
6969//!
7070//! // Encrypt block in-place
7171//! cipher.encrypt_block(&mut block);
Original file line number Diff line number Diff line change 1818//! // Initialize cipher
1919//! let cipher = Aria128::new(&key);
2020//!
21- //! let block_copy = block.clone() ;
21+ //! let block_copy = block;
2222//! // Encrypt block in-place
2323//! cipher.encrypt_block(&mut block);
2424//! // And decrypt it back
Original file line number Diff line number Diff line change 1818//! // Initialize cipher
1919//! let cipher = Cast5::new(&key);
2020//!
21- //! let block_copy = block.clone() ;
21+ //! let block_copy = block;
2222//! // Encrypt block in-place
2323//! cipher.encrypt_block(&mut block);
2424//! // And decrypt it back
Original file line number Diff line number Diff line change 1818//! // Initialize cipher
1919//! let cipher = Cast6::new(&key);
2020//!
21- //! let block_copy = block.clone() ;
21+ //! let block_copy = block;
2222//! // Encrypt block in-place
2323//! cipher.encrypt_block(&mut block);
2424//! // And decrypt it back
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ macro_rules! new_test {
2222 let ciphertext = hex!( $ct_hex) ;
2323 let cipher = $cipher:: new( & key. into( ) ) ;
2424
25- let mut block = plaintext. clone ( ) . into( ) ;
25+ let mut block = plaintext. into( ) ;
2626 cipher. encrypt_block( & mut block) ;
2727
2828 assert_eq!( & ciphertext, block. as_slice( ) ) ;
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ macro_rules! new_test {
1717 for i in 1 ..50 {
1818 let twofish = Twofish :: new_from_slice( & key) . unwrap( ) ;
1919
20- let mut buf = plain. clone ( ) ;
20+ let mut buf = plain;
2121 twofish. encrypt_block( & mut buf) ;
22- cipher = buf. clone ( ) ;
22+ cipher = buf;
2323 twofish. decrypt_block( & mut buf) ;
2424 assert_eq!( plain, buf) ;
2525
You can’t perform that action at this time.
0 commit comments