fix salsa20 for UDP
This commit is contained in:
parent
040c956472
commit
2950f99da6
1 changed files with 6 additions and 3 deletions
|
@ -216,9 +216,12 @@ def encrypt_all(password, method, op, data):
|
||||||
else:
|
else:
|
||||||
iv = data[:iv_len]
|
iv = data[:iv_len]
|
||||||
data = data[iv_len:]
|
data = data[iv_len:]
|
||||||
cipher = M2Crypto.EVP.Cipher(method.replace('-', '_'), key, iv, op,
|
if method != 'salsa20-ctr':
|
||||||
key_as_bytes=0, d='md5', salt=None, i=1,
|
cipher = M2Crypto.EVP.Cipher(method.replace('-', '_'), key, iv,
|
||||||
padding=1)
|
op, key_as_bytes=0, d='md5',
|
||||||
|
salt=None, i=1, padding=1)
|
||||||
|
else:
|
||||||
|
cipher = encrypt_salsa20.Salsa20Cipher(method, key, iv, op)
|
||||||
result.append(cipher.update(data))
|
result.append(cipher.update(data))
|
||||||
f = cipher.final()
|
f = cipher.final()
|
||||||
if f:
|
if f:
|
||||||
|
|
Loading…
Reference in a new issue