aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-01-29 23:48:13 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-01-29 23:48:13 +0000
commit023abb060f52cb2f401905dfbb4e2ce0af271273 (patch)
tree8b34be41f1af75a543667ff6c1290c4162216a53 /contrib
parent6eac3649f809f91e3ee53e8d7ace2c4ead8b848c (diff)
downloadrspamd-023abb060f52cb2f401905dfbb4e2ce0af271273.tar.gz
rspamd-023abb060f52cb2f401905dfbb4e2ce0af271273.zip
Fix detached cryptobox.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/tweetnacl/tweetnacl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/tweetnacl/tweetnacl.c b/contrib/tweetnacl/tweetnacl.c
index b414ffc25..41eb3aeca 100644
--- a/contrib/tweetnacl/tweetnacl.c
+++ b/contrib/tweetnacl/tweetnacl.c
@@ -165,9 +165,10 @@ int crypto_stream_salsa20_xor2(u8 *c1, u8 *c2,const u8 *m1,const u8 *m2,u64 d1,u
if (r > 0) {
if (r <= b) {
FOR(i,r) c[i] = (m?m[i]:0) ^ x[i];
- r = 0;
m += r;
+ c += r;
b -= r;
+ r = 0;
}
else {
FOR(i,b) c[i] = (m?m[i]:0) ^ x[i];