]> source.dussan.org Git - rspamd.git/commitdiff
Fix detached cryptobox.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 29 Jan 2015 23:48:13 +0000 (23:48 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 29 Jan 2015 23:48:13 +0000 (23:48 +0000)
contrib/tweetnacl/tweetnacl.c

index b414ffc25fafc5e4509e4b53a65cf491c06e203f..41eb3aeca0f3db7d78e8c2cd92da071a619ba905 100644 (file)
@@ -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];