From e6416562fc92d81db6e47415553f47abb5ae93c9 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Wed, 10 Dec 2014 23:19:11 +0800 Subject: [PATCH] add salsa20 and chacha20 --- shadowsocks/crypto/ctypes_libsodium.py | 2 +- shadowsocks/encrypt.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/shadowsocks/crypto/ctypes_libsodium.py b/shadowsocks/crypto/ctypes_libsodium.py index 1e81060..efecfd4 100644 --- a/shadowsocks/crypto/ctypes_libsodium.py +++ b/shadowsocks/crypto/ctypes_libsodium.py @@ -24,7 +24,7 @@ from __future__ import absolute_import, division, print_function, \ with_statement import logging -from ctypes import CDLL, c_char_p, c_int, c_long, c_ulonglong, byref, \ +from ctypes import CDLL, c_char_p, c_int, c_ulonglong, byref, \ create_string_buffer, c_void_p __all__ = ['ciphers'] diff --git a/shadowsocks/encrypt.py b/shadowsocks/encrypt.py index 2043001..0f6aba8 100644 --- a/shadowsocks/encrypt.py +++ b/shadowsocks/encrypt.py @@ -28,13 +28,15 @@ import sys import hashlib import logging -from shadowsocks.crypto import m2, rc4_md5, salsa20_ctr, ctypes_openssl, table +from shadowsocks.crypto import m2, rc4_md5, salsa20_ctr,\ + ctypes_openssl, ctypes_libsodium, table method_supported = {} method_supported.update(rc4_md5.ciphers) method_supported.update(salsa20_ctr.ciphers) method_supported.update(ctypes_openssl.ciphers) +method_supported.update(ctypes_libsodium.ciphers) # let M2Crypto override ctypes_openssl method_supported.update(m2.ciphers) method_supported.update(table.ciphers)