From: Mikael Kanstrup Date: Tue, 19 Jun 2018 11:52:29 +0000 (+0200) Subject: crypto internal: Make MD4 PADDING array const X-Git-Tag: hostap_2_8~604 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e5904cf4644bfe3f20cafe49a3dd2e5e5f0cf9f0;p=thirdparty%2Fhostap.git crypto internal: Make MD4 PADDING array const 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 --- diff --git a/src/crypto/md4-internal.c b/src/crypto/md4-internal.c index d9c737a29..cf408e84f 100644 --- a/src/crypto/md4-internal.c +++ b/src/crypto/md4-internal.c @@ -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