No need to zero the counter

This commit is contained in:
Frank Denis 2015-11-25 14:19:44 +01:00
parent 1c8e34577f
commit a879c090b4

View File

@ -303,7 +303,6 @@ stream_ref_xor_ic(unsigned char *c, const unsigned char *m,
chacha_encrypt_bytes(&ctx, m, c, mlen); chacha_encrypt_bytes(&ctx, m, c, mlen);
sodium_memzero(&ctx, sizeof ctx); sodium_memzero(&ctx, sizeof ctx);
sodium_memzero(ic_bytes, sizeof ic_bytes);
return 0; 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_ietf_ivsetup(&ctx, n, ic_bytes);
chacha_encrypt_bytes(&ctx, m, c, mlen); chacha_encrypt_bytes(&ctx, m, c, mlen);
sodium_memzero(&ctx, sizeof ctx); sodium_memzero(&ctx, sizeof ctx);
sodium_memzero(ic_bytes, sizeof ic_bytes);
return 0; return 0;
} }