]> git.neil.brown.name Git - history.git/commitdiff
Fix sha256 padding block initializer to be static.
authorLinus Torvalds <torvalds@home.osdl.org>
Fri, 30 Jan 2004 00:41:00 +0000 (16:41 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 30 Jan 2004 00:41:00 +0000 (16:41 -0800)
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

index 030fe5cc6a644b18940ad7025f5ed31d2ec3ee95..8122872e414f276b3bc0610ee6704118281bb444 100644 (file)
@@ -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];