1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 00:32:04 +02:00

Kconfig: Add CONFIG_HASH to enable hashing API

At present CONFIG_CMD_HASH enables the 'hash' command which also brings
in the hashing API. Some boards may wish to enable the API without the
command. Add a separate CONFIG to permit this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Simon Glass
2017-05-17 09:05:34 -06:00
committed by Tom Rini
parent 551c393446
commit d70f919e49
4 changed files with 17 additions and 3 deletions

View File

@@ -350,6 +350,7 @@ config CMD_MEMORY
config CMD_CRC32 config CMD_CRC32
bool "crc32" bool "crc32"
select HASH
default y default y
help help
Compute CRC32. Compute CRC32.
@@ -998,6 +999,7 @@ config CMD_BLOB
config CMD_HASH config CMD_HASH
bool "Support 'hash' command" bool "Support 'hash' command"
select HASH
help help
This provides a way to hash data in memory using various supported This provides a way to hash data in memory using various supported
algorithms (such as SHA1, MD5, CRC32). The computed digest can be algorithms (such as SHA1, MD5, CRC32). The computed digest can be

View File

@@ -493,4 +493,16 @@ config BOARD_EARLY_INIT_F
endmenu endmenu
menu "Security support"
config HASH
bool # "Support hashing API (SHA1, SHA256, etc.)"
help
This provides a way to hash data in memory using various supported
algorithms (such as SHA1, MD5, CRC32). The API is defined in hash.h
and the algorithms it supports are defined in common/hash.c. See
also CMD_HASH for command-line access.
endmenu
source "common/spl/Kconfig" source "common/spl/Kconfig"

View File

@@ -10,7 +10,7 @@ ifndef CONFIG_SPL_BUILD
obj-y += init/ obj-y += init/
obj-y += main.o obj-y += main.o
obj-y += exports.o obj-y += exports.o
obj-y += hash.o obj-$(CONFIG_HASH) += hash.o
obj-$(CONFIG_HUSH_PARSER) += cli_hush.o obj-$(CONFIG_HUSH_PARSER) += cli_hush.o
obj-$(CONFIG_AUTOBOOT) += autoboot.o obj-$(CONFIG_AUTOBOOT) += autoboot.o

View File

@@ -473,5 +473,5 @@ int hash_command(const char *algo_name, int flags, cmd_tbl_t *cmdtp, int flag,
return 0; return 0;
} }
#endif #endif /* CONFIG_CMD_HASH || CONFIG_CMD_SHA1SUM || CONFIG_CMD_CRC32) */
#endif #endif /* !USE_HOSTCC */