From a251c9ff15ae1fb53a83c43f70041ec47dacead8 Mon Sep 17 00:00:00 2001 From: Dom Crossley Date: Wed, 7 Dec 2016 09:33:55 +0000 Subject: [PATCH] Update the index into a partial Poly1305 buffer instead of overwriting --- cbits/cryptonite_poly1305.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cbits/cryptonite_poly1305.c b/cbits/cryptonite_poly1305.c index 60dc5e0..3ae193e 100644 --- a/cbits/cryptonite_poly1305.c +++ b/cbits/cryptonite_poly1305.c @@ -132,7 +132,7 @@ void cryptonite_poly1305_update(poly1305_ctx *ctx, uint8_t *data, uint32_t lengt /* fill the remaining bytes in the partial buffer */ if (length) { memcpy(ctx->buf + ctx->index, data, length); - ctx->index = length; + ctx->index += length; } }