@@ -196,44 +196,40 @@ mod tests {
196196 crate :: test_utils:: test_aes_symmetric!( Aes128CtrCipher , 16 , "AES-128-CTR" ) ;
197197
198198 #[ test]
199- fn test_aes_128_ctr_with_iv ( ) -> Result < ( ) , CryptoError > {
199+ fn test_aes_128_ctr_with_iv ( ) {
200200 let cipher = Aes128CtrCipher :: new ( ) ;
201201 let key = [ 0x42u8 ; 16 ] ;
202202 let iv = [ 0x12u8 ; 16 ] ;
203203 let plaintext = b"Test with specific IV" ;
204204
205205 // Test encryption with specific IV
206- let ciphertext = cipher. encrypt_with_iv ( key, iv, plaintext) ? ;
206+ let ciphertext = cipher. encrypt_with_iv ( key, iv, plaintext) . unwrap ( ) ;
207207 assert_ne ! ( ciphertext. as_slice( ) , plaintext) ;
208208 assert_eq ! ( ciphertext. len( ) , plaintext. len( ) ) ; // CTR preserves length
209209
210210 // Test decryption with same IV
211- let decrypted = cipher. decrypt_with_iv ( key, iv, & ciphertext) ? ;
211+ let decrypted = cipher. decrypt_with_iv ( key, iv, & ciphertext) . unwrap ( ) ;
212212 assert_eq ! ( decrypted, plaintext) ;
213-
214- Ok ( ( ) )
215213 }
216214
217215 #[ test]
218- fn test_aes_128_ctr_deterministic_with_same_iv ( ) -> Result < ( ) , CryptoError > {
216+ fn test_aes_128_ctr_deterministic_with_same_iv ( ) {
219217 let cipher = Aes128CtrCipher :: new ( ) ;
220218 let key = [ 0x42u8 ; 16 ] ;
221219 let iv = [ 0x12u8 ; 16 ] ;
222220 let plaintext = b"Same plaintext" ;
223221
224222 // Encrypt the same plaintext with the same IV twice
225223 // Should be identical (deterministic with same key + IV)
226- let ciphertext1 = cipher. encrypt_with_iv ( key, iv, plaintext) ? ;
227- let ciphertext2 = cipher. encrypt_with_iv ( key, iv, plaintext) ? ;
224+ let ciphertext1 = cipher. encrypt_with_iv ( key, iv, plaintext) . unwrap ( ) ;
225+ let ciphertext2 = cipher. encrypt_with_iv ( key, iv, plaintext) . unwrap ( ) ;
228226 assert_eq ! ( ciphertext1, ciphertext2) ;
229227
230228 // Both should decrypt correctly
231- let decrypted1 = cipher. decrypt_with_iv ( key, iv, & ciphertext1) ? ;
232- let decrypted2 = cipher. decrypt_with_iv ( key, iv, & ciphertext2) ? ;
229+ let decrypted1 = cipher. decrypt_with_iv ( key, iv, & ciphertext1) . unwrap ( ) ;
230+ let decrypted2 = cipher. decrypt_with_iv ( key, iv, & ciphertext2) . unwrap ( ) ;
233231 assert_eq ! ( decrypted1, plaintext) ;
234232 assert_eq ! ( decrypted2, plaintext) ;
235-
236- Ok ( ( ) )
237233 }
238234
239235 #[ test]
@@ -248,41 +244,37 @@ mod tests {
248244 }
249245
250246 #[ test]
251- fn test_aes_128_ctr_default_constructor ( ) -> Result < ( ) , CryptoError > {
247+ fn test_aes_128_ctr_default_constructor ( ) {
252248 // This fixes coverage issues and ensures the default is covered
253249 #[ allow( clippy:: default_constructed_unit_structs) ]
254250 let cipher = Aes128CtrCipher :: default ( ) ;
255251 let key = [ 0x42u8 ; 16 ] ;
256252 let plaintext = b"Default constructor test" ;
257253
258- let ciphertext = cipher. encrypt ( key, None , plaintext) ? ;
259- let decrypted = cipher. decrypt ( key, & ciphertext) ? ;
254+ let ciphertext = cipher. encrypt ( key, None , plaintext) . unwrap ( ) ;
255+ let decrypted = cipher. decrypt ( key, & ciphertext) . unwrap ( ) ;
260256 assert_eq ! ( decrypted, plaintext) ;
261-
262- Ok ( ( ) )
263257 }
264258
265259 #[ test]
266- fn test_aes_128_ctr_stream_property ( ) -> Result < ( ) , CryptoError > {
260+ fn test_aes_128_ctr_stream_property ( ) {
267261 let cipher = Aes128CtrCipher :: new ( ) ;
268262 let key = [ 0x42u8 ; 16 ] ;
269263 let iv = [ 0x12u8 ; 16 ] ;
270264
271265 let plaintext1 = b"short" ;
272266 let plaintext2 = b"a much longer plaintext message" ;
273267
274- let ciphertext1 = cipher. encrypt_with_iv ( key, iv, plaintext1) ? ;
275- let ciphertext2 = cipher. encrypt_with_iv ( key, iv, plaintext2) ? ;
268+ let ciphertext1 = cipher. encrypt_with_iv ( key, iv, plaintext1) . unwrap ( ) ;
269+ let ciphertext2 = cipher. encrypt_with_iv ( key, iv, plaintext2) . unwrap ( ) ;
276270 assert_eq ! ( ciphertext1. len( ) , plaintext1. len( ) ) ;
277271 assert_eq ! ( ciphertext2. len( ) , plaintext2. len( ) ) ;
278272
279273 // Verify decryption works correctly
280- let decrypted1 = cipher. decrypt_with_iv ( key, iv, & ciphertext1) ? ;
281- let decrypted2 = cipher. decrypt_with_iv ( key, iv, & ciphertext2) ? ;
274+ let decrypted1 = cipher. decrypt_with_iv ( key, iv, & ciphertext1) . unwrap ( ) ;
275+ let decrypted2 = cipher. decrypt_with_iv ( key, iv, & ciphertext2) . unwrap ( ) ;
282276 assert_eq ! ( decrypted1, plaintext1) ;
283277 assert_eq ! ( decrypted2, plaintext2) ;
284-
285- Ok ( ( ) )
286278 }
287279
288280 #[ test]
0 commit comments