vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c in rbnacl-libsodium-1.0.8 vs vendor/libsodium/src/libsodium/crypto_stream/salsa208/ref/stream_salsa208.c in rbnacl-libsodium-1.0.9

- old
+ new

@@ -6,16 +6,10 @@ #include "crypto_core_salsa208.h" #include "crypto_stream_salsa208.h" #include "utils.h" -typedef unsigned int uint32; - -static const unsigned char sigma[16] = { - 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', '2', '-', 'b', 'y', 't', 'e', ' ', 'k' -}; - int crypto_stream_salsa208( unsigned char *c,unsigned long long clen, const unsigned char *n, const unsigned char *k ) @@ -31,11 +25,11 @@ for (i = 0;i < 32;++i) kcopy[i] = k[i]; for (i = 0;i < 8;++i) in[i] = n[i]; for (i = 8;i < 16;++i) in[i] = 0; while (clen >= 64) { - crypto_core_salsa208(c,in,kcopy,sigma); + crypto_core_salsa208(c,in,kcopy,NULL); u = 1; for (i = 8;i < 16;++i) { u += (unsigned int) in[i]; in[i] = u; @@ -45,10 +39,10 @@ clen -= 64; c += 64; } if (clen) { - crypto_core_salsa208(block,in,kcopy,sigma); + crypto_core_salsa208(block,in,kcopy,NULL); for (i = 0;i < (unsigned int) clen;++i) c[i] = block[i]; } sodium_memzero(block, sizeof block); sodium_memzero(kcopy, sizeof kcopy);