aboutsummaryrefslogtreecommitdiffstats
path: root/src/tweetpipe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tweetpipe.c')
-rw-r--r--src/tweetpipe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tweetpipe.c b/src/tweetpipe.c
index 9dd5676..f146cd7 100644
--- a/src/tweetpipe.c
+++ b/src/tweetpipe.c
@@ -65,8 +65,8 @@ stream_encrypt(Context *ctx)
{
unsigned char *const chunk_size_p = ctx->buf;
unsigned char *const chunk_nonce = chunk_size_p + 4;
- unsigned char *const chunk_base = chunk_size_p + 4 + crypto_secretbox_NONCEBYTES - crypto_secretbox_BOXZEROBYTES;
- unsigned char *const chunk_msg = chunk_size_p + 4 + crypto_secretbox_NONCEBYTES - crypto_secretbox_BOXZEROBYTES + crypto_secretbox_ZEROBYTES;
+ unsigned char *const chunk_base = chunk_nonce + crypto_secretbox_NONCEBYTES - crypto_secretbox_BOXZEROBYTES;
+ unsigned char *const chunk_msg = chunk_base + crypto_secretbox_ZEROBYTES;
unsigned char nonce[crypto_secretbox_NONCEBYTES];
uint64_t chunk_id;
ssize_t max_chunk_size;
@@ -105,8 +105,8 @@ stream_decrypt(Context *ctx)
{
unsigned char *const chunk_size_p = ctx->buf;
unsigned char *const chunk_nonce = chunk_size_p + 4;
- unsigned char *const chunk_base = chunk_size_p + 4 + crypto_secretbox_NONCEBYTES - crypto_secretbox_BOXZEROBYTES;
- unsigned char *const chunk_msg = chunk_size_p + 4 + crypto_secretbox_NONCEBYTES - crypto_secretbox_BOXZEROBYTES + crypto_secretbox_ZEROBYTES;
+ unsigned char *const chunk_base = chunk_nonce + crypto_secretbox_NONCEBYTES - crypto_secretbox_BOXZEROBYTES;
+ unsigned char *const chunk_msg = chunk_base + crypto_secretbox_ZEROBYTES;
unsigned char nonce[crypto_secretbox_NONCEBYTES];
uint64_t chunk_id;
ssize_t readnb;