summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2014-02-08 21:08:12 +0100
committerNiels Möller <nisse@lysator.liu.se>2014-02-08 21:08:12 +0100
commit9fadf064b7328c99cd365811989e9ee2c27a6bca (patch)
treee9d0283ac66cbf592c50b989654e248836717853
parentb99fd6277a3b4a300ee072bfe604ba0068d81ca0 (diff)
downloadnettle-9fadf064b7328c99cd365811989e9ee2c27a6bca.tar.gz
chacha_crypt: Fixed block counter update.
-rw-r--r--ChangeLog4
-rw-r--r--chacha-crypt.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fdc4a0f1..a1030c95 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-02-08 Niels Möller <nisse@lysator.liu.se>
+
+ * chacha-crypt.c (chacha_crypt): Fixed block counter update.
+
2014-02-07 Niels Möller <nisse@lysator.liu.se>
* nettle.texinfo (ASCII encoding): Document that
diff --git a/chacha-crypt.c b/chacha-crypt.c
index 2fb77777..60e2a539 100644
--- a/chacha-crypt.c
+++ b/chacha-crypt.c
@@ -60,7 +60,7 @@ chacha_crypt(struct chacha_ctx *ctx,
_chacha_core (x, ctx->state, CHACHA_ROUNDS);
- ctx->state[9] += (++ctx->state[8] == 0);
+ ctx->state[13] += (++ctx->state[12] == 0);
/* stopping at 2^70 length per nonce is user's responsibility */