Beispiel #1
0
 def it_throws_on_invalid_padding(self):
     crypto.strip_byte_padding(b'abc\x03\x03\x04', 6)
Beispiel #2
0
 def it_throws_on_invalid_padding(self):
     crypto.strip_byte_padding(b'abc\x03\x03\x04', 6)
Beispiel #3
0
 def it_strips_byte_padding_at_specified_length(self):
     assert crypto.strip_byte_padding(b'', 6) == b''
     assert crypto.strip_byte_padding(b'abcd\x02\x02', 6) == b'abcd'
     assert crypto.strip_byte_padding(b'abcdef', 3) == b'abcdef'
     assert crypto.strip_byte_padding(b'abcdef', 6) == b'abcdef'
Beispiel #4
0
 def it_strips_byte_padding_at_specified_length(self):
     assert crypto.strip_byte_padding(b'', 6) == b''
     assert crypto.strip_byte_padding(b'abcd\x02\x02', 6) == b'abcd'
     assert crypto.strip_byte_padding(b'abcdef', 3) == b'abcdef'
     assert crypto.strip_byte_padding(b'abcdef', 6) == b'abcdef'