Browse Source

add salsa20 and chacha20

auth
clowwindy 10 years ago
parent
commit
e6416562fc
  1. 2
      shadowsocks/crypto/ctypes_libsodium.py
  2. 4
      shadowsocks/encrypt.py

2
shadowsocks/crypto/ctypes_libsodium.py

@ -24,7 +24,7 @@ from __future__ import absolute_import, division, print_function, \
with_statement with_statement
import logging 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 create_string_buffer, c_void_p
__all__ = ['ciphers'] __all__ = ['ciphers']

4
shadowsocks/encrypt.py

@ -28,13 +28,15 @@ import sys
import hashlib import hashlib
import logging 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 = {}
method_supported.update(rc4_md5.ciphers) method_supported.update(rc4_md5.ciphers)
method_supported.update(salsa20_ctr.ciphers) method_supported.update(salsa20_ctr.ciphers)
method_supported.update(ctypes_openssl.ciphers) method_supported.update(ctypes_openssl.ciphers)
method_supported.update(ctypes_libsodium.ciphers)
# let M2Crypto override ctypes_openssl # let M2Crypto override ctypes_openssl
method_supported.update(m2.ciphers) method_supported.update(m2.ciphers)
method_supported.update(table.ciphers) method_supported.update(table.ciphers)

Loading…
Cancel
Save