From ae05f3fae32be240b8792c48351eefedb128f1f9 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 29 Jan 2004 16:41:00 -0800 Subject: [PATCH] Fix sha256 padding block initializer to be static. Jakub points out that having an automatic array is not only bad for performance (and stack usage), gcc has also historically had lots of bugs here, and gcc-3.2.3 seems to miscompile it otherwise. --- crypto/sha256.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/sha256.c b/crypto/sha256.c index 030fe5cc6a644..8122872e414f2 100644 --- a/crypto/sha256.c +++ b/crypto/sha256.c @@ -295,7 +295,7 @@ static void sha256_final(void* ctx, u8 *out) u8 bits[8]; unsigned int index, pad_len, t; int i, j; - const u8 padding[64] = { 0x80, }; + static const u8 padding[64] = { 0x80, }; /* Save number of bits */ t = sctx->count[0]; -- 2.53.0