9
0
Fork 0
barebox/crypto
Alexander Shiyan 2049dbb6fe crypto: crc32: Optimize dynamic CRC table generation
In barebox we have an option for dynamic formation of the CRC32
table (DYNAMIC_CRC_TABLE), but the source code declares a static
array which is simply filled with data, the resulting code becomes
even more than without DYNAMIC_CRC_TABLE option, due to the BSS usage.
CONFIG_DYNAMIC_CRC_TABLE=n
   text    data     bss     dec     hex filename
   1884       0       0    1884     75c crc32.o
CONFIG_DYNAMIC_CRC_TABLE=y
   text    data     bss     dec     hex filename
   1066       4    1024    2094     82e crc32.o

This patch provides dynamic buffer allocation for the CRC table,
which saves about 1 Kbyte, as it should be.
CONFIG_DYNAMIC_CRC_TABLE=y
   text    data     bss     dec     hex filename
   1062       0       4    1066     42a crc32.o

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-07-05 09:02:40 +02:00
..
Kconfig crypto: add CRC32 digest 2016-05-25 10:41:30 +02:00
Makefile crypto: add CRC32 digest 2016-05-25 10:41:30 +02:00
crc7.c crypto: Add crc7 function 2011-11-25 12:37:25 +01:00
crc16.c crc16: Make buffer argument const 2015-06-08 13:47:54 +02:00
crc32.c crypto: crc32: Optimize dynamic CRC table generation 2016-07-05 09:02:40 +02:00
crc32_digest.c crypto: add CRC32 digest 2016-05-25 10:41:30 +02:00
digest.c whole tree: remove trailing whitespaces 2016-04-21 15:17:52 +02:00
hmac.c string: Fix (v)asprintf prototypes 2016-04-15 12:21:45 +02:00
keystore.c crypto: add simple keystore 2015-11-27 08:26:40 +01:00
md5.c crypto: add digest_alloc_by_algo() 2016-01-26 22:45:41 +01:00
pbkdf2.c crypto: add pbkdf2 hmac key generator 2015-03-19 07:46:22 +01:00
rsa.c crypto: add RSA support 2016-01-26 22:45:41 +01:00
sha1.c crypto: add digest_alloc_by_algo() 2016-01-26 22:45:41 +01:00
sha2.c whole tree: remove trailing whitespaces 2016-04-21 15:17:52 +02:00
sha4.c crypto: add digest_alloc_by_algo() 2016-01-26 22:45:41 +01:00