From a879c090b4e902da54a4cece734e53611307401a Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 25 Nov 2015 14:19:44 +0100 Subject: [PATCH] No need to zero the counter --- src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.c b/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.c index f6fab60c..a49fe63f 100644 --- a/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.c +++ b/src/libsodium/crypto_stream/chacha20/ref/stream_chacha20_ref.c @@ -303,7 +303,6 @@ stream_ref_xor_ic(unsigned char *c, const unsigned char *m, chacha_encrypt_bytes(&ctx, m, c, mlen); sodium_memzero(&ctx, sizeof ctx); - sodium_memzero(ic_bytes, sizeof ic_bytes); return 0; } @@ -325,7 +324,6 @@ stream_ietf_ref_xor_ic(unsigned char *c, const unsigned char *m, chacha_ietf_ivsetup(&ctx, n, ic_bytes); chacha_encrypt_bytes(&ctx, m, c, mlen); sodium_memzero(&ctx, sizeof ctx); - sodium_memzero(ic_bytes, sizeof ic_bytes); return 0; }