]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
crypto internal: Make MD4 PADDING array const
authorMikael Kanstrup <mikael.kanstrup@sony.com>
Tue, 19 Jun 2018 11:52:29 +0000 (13:52 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 2 Jan 2019 15:26:57 +0000 (17:26 +0200)
The PADDING array used when adding padding bits in MD4 never change
so can be made const. Making it const puts the array in .rodata
section and can save a few bytes of RAM for systems running without
virtual memory.

Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
src/crypto/md4-internal.c

index d9c737a2970b61ba2de3dfa847d139c3862baef7..cf408e84fae6a70184c1015ec41ce5ac827c181c 100644 (file)
@@ -85,7 +85,7 @@ MD4Transform(u32 state[4], const u8 block[MD4_BLOCK_LENGTH]);
        (cp)[1] = (value) >> 8;                                         \
        (cp)[0] = (value); } while (0)
 
-static u8 PADDING[MD4_BLOCK_LENGTH] = {
+static const u8 PADDING[MD4_BLOCK_LENGTH] = {
        0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0