Browse Source

ignore error if not support "chacha20-ietf"

dev
BreakWa11 9 years ago
parent
commit
ddcf7f796f
  1. 5
      shadowsocks/crypto/sodium.py

5
shadowsocks/crypto/sodium.py

@ -29,7 +29,7 @@ loaded = False
buf_size = 2048 buf_size = 2048
# for salsa20 and chacha20 # for salsa20 and chacha20 and chacha20-ietf
BLOCK_SIZE = 64 BLOCK_SIZE = 64
@ -52,11 +52,14 @@ def load_libsodium():
c_char_p, c_ulonglong, c_char_p, c_ulonglong,
c_char_p) c_char_p)
try:
libsodium.crypto_stream_chacha20_ietf_xor_ic.restype = c_int libsodium.crypto_stream_chacha20_ietf_xor_ic.restype = c_int
libsodium.crypto_stream_chacha20_ietf_xor_ic.argtypes = (c_void_p, c_char_p, libsodium.crypto_stream_chacha20_ietf_xor_ic.argtypes = (c_void_p, c_char_p,
c_ulonglong, c_ulonglong,
c_char_p, c_ulonglong, c_char_p, c_ulonglong,
c_char_p) c_char_p)
except:
pass
buf = create_string_buffer(buf_size) buf = create_string_buffer(buf_size)
loaded = True loaded = True

Loading…
Cancel
Save