]> git.ipfire.org Git - people/ms/u-boot.git/commit - common/hash.c
hash: Compile only hardware or software versions of SHA algorithms
authorTom Rini <trini@konsulko.com>
Mon, 14 Aug 2017 20:38:07 +0000 (16:38 -0400)
committerTom Rini <trini@konsulko.com>
Sun, 20 Aug 2017 13:53:13 +0000 (09:53 -0400)
commit78eda89e9a25810d58dc6df86dbe5d8902cbb90c
treec9af1f66f2a17f8c263a3441e8e5eedf04af9ce6
parent3809e30273e03d762595dbc2a62f3a8398281ec8
hash: Compile only hardware or software versions of SHA algorithms

Commit 089df18bfe9d ("lib: move hash CONFIG options to Kconfig") moved
CONFIG_SHA1, CONFIG_SHA256, CONFIG_SHA_HW_ACCEL, and
CONFIG_SHA_PROG_HW_ACCEL config options to Kconfig. So in the case of
SPL, CONFIG_SPL_HASH_SUPPORT enables CONFIG_SHA1 and CONFIG_SHA256 which
enables SHA SW library by default.  But in the case of platforms with
SHA HW library support, SHA SW library becomes redundant and increases
size of SPL by approx 18K.  Rework the code so that we have named
members and only have either software or hardware versions of the
algorithm, depending on the relevant config options.  Update the comment
around hash_algo to reflect this as well.

Reported-by: Sumit Garg <sumit.garg@nxp.com>
Cc: Sumit Garg <sumit.garg@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Sumit Garg <sumit.garg@nxp.com>
common/hash.c