From 90258b6f3433e0e6742ae85caa5342a01d259b48 Mon Sep 17 00:00:00 2001 From: Hayden Roche Date: Tue, 27 Oct 2020 21:10:27 -0500 Subject: [PATCH] Fix MSVC compile issue in chacha.c. Use XMEMSET instead of initializing with {}. --- wolfcrypt/src/chacha.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/chacha.c b/wolfcrypt/src/chacha.c index e109c44da..32feccf86 100644 --- a/wolfcrypt/src/chacha.c +++ b/wolfcrypt/src/chacha.c @@ -442,7 +442,8 @@ int wc_Chacha_Process(ChaCha* ctx, byte* output, const byte* input, void wc_Chacha_purge_current_block(ChaCha* ctx) { if (ctx->left > 0) { - byte scratch[CHACHA_CHUNK_BYTES] = {0}; + byte scratch[CHACHA_CHUNK_BYTES]; + XMEMSET(scratch, 0, sizeof(scratch)); (void)wc_Chacha_Process(ctx, scratch, scratch, CHACHA_CHUNK_BYTES - ctx->left); } }