File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -877,7 +877,7 @@ def test_aesctr_key_decrypt_with_invalid_nonce(self):
877877 nonce = token_bytes (16 )
878878 encrypted = key .encrypt (b"Hello world!" , nonce = nonce )
879879 # alternate the nonce by incrementing the last byte
880- invalid_nonce = nonce [0 :- 1 ] + (nonce [- 1 ] + 1 % 256 ).to_bytes (1 , "big" )
880+ invalid_nonce = nonce [0 :- 1 ] + (( nonce [- 1 ] + 1 ) % 256 ).to_bytes (1 , "big" )
881881 assert nonce != invalid_nonce
882882 decrypted = key .decrypt (encrypted , nonce = invalid_nonce )
883883 assert encrypted != decrypted
@@ -1035,7 +1035,7 @@ def test_aescbc_key_decrypt_with_invalid_nonce(self):
10351035 nonce = token_bytes (16 )
10361036 encrypted = key .encrypt (b"Hello world!" , nonce = nonce )
10371037 # alternate the nonce by incrementing the last byte
1038- invalid_nonce = nonce [0 :- 1 ] + (nonce [- 1 ] + 1 % 256 ).to_bytes (1 , "big" )
1038+ invalid_nonce = nonce [0 :- 1 ] + (( nonce [- 1 ] + 1 ) % 256 ).to_bytes (1 , "big" )
10391039 assert nonce != invalid_nonce
10401040 decrypted = key .decrypt (encrypted , nonce = invalid_nonce )
10411041 assert encrypted != decrypted
You can’t perform that action at this time.
0 commit comments