MCPcopy
hub / github.com/shadowsocks/shadowsocks / test_encryptor

Function test_encryptor

shadowsocks/encrypt.py:202–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

200
201
202def test_encryptor():
203 from os import urandom
204 plain = urandom(10240)
205 for method in CIPHERS_TO_TEST:
206 logging.warn(method)
207 encryptor = Encryptor(b'key', method)
208 decryptor = Encryptor(b'key', method)
209 cipher = encryptor.encrypt(plain)
210 plain2 = decryptor.decrypt(cipher)
211 assert plain == plain2
212
213
214def test_encrypt_all():

Callers 1

encrypt.pyFile · 0.85

Calls 3

encryptMethod · 0.95
decryptMethod · 0.95
EncryptorClass · 0.85

Tested by

no test coverage detected