def test_chacha20(): from ssshare.shadowsocks.crypto import util cipher = Salsa20Crypto(b'chacha20', b'k' * 32, b'i' * 16, 1) decipher = Salsa20Crypto(b'chacha20', b'k' * 32, b'i' * 16, 0) util.run_cipher(cipher, decipher)
def test_encryption(): from ssshare.shadowsocks.crypto import util cipher = TableCipher('table', b'test', b'', 1) decipher = TableCipher('table', b'test', b'', 0) util.run_cipher(cipher, decipher)
def test(): from ssshare.shadowsocks.crypto import util cipher = create_cipher('rc4-md5', b'k' * 32, b'i' * 16, 1) decipher = create_cipher('rc4-md5', b'k' * 32, b'i' * 16, 0) util.run_cipher(cipher, decipher)
def run_method(method): from ssshare.shadowsocks.crypto import util cipher = CtypesCrypto(method, b'k' * 32, b'i' * 16, 1) decipher = CtypesCrypto(method, b'k' * 32, b'i' * 16, 0) util.run_cipher(cipher, decipher)
def test_chacha20_ietf(): cipher = SodiumCrypto('chacha20-ietf', b'k' * 32, b'i' * 16, 1) decipher = SodiumCrypto('chacha20-ietf', b'k' * 32, b'i' * 16, 0) util.run_cipher(cipher, decipher)
def test_salsa20(): cipher = SodiumCrypto('salsa20', b'k' * 32, b'i' * 16, 1) decipher = SodiumCrypto('salsa20', b'k' * 32, b'i' * 16, 0) util.run_cipher(cipher, decipher)
def run_method(method): cipher = OpenSSLCrypto(method, b'k' * 32, b'i' * 16, 1) decipher = OpenSSLCrypto(method, b'k' * 32, b'i' * 16, 0) util.run_cipher(cipher, decipher)