mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
hash: Kconfig option for SHA512 hardware acceleration
Commita479f103dc
("hash: Allow for SHA512 hardware implementations") defined function definitions for hardware accelerated SHA384 and SHA512. If CONFIG_SHA_HW_ACCEL=y, these functions are used. We already have boards using CONFIG_SHA_HW_ACCEL=y but none implements the new functions hw_sha384() and hw_sha512(). For implementing the EFI TCG2 protocol we need SHA384 and SHA512. The missing hardware acceleration functions lead to build errors on boards like peach-pi_defconfig. Introduce a new Kconfig symbol CONFIG_SHA512_HW_ACCEL to control if the functions hw_sha384() and hw_sha512() shall be used to implement the SHA384 and SHA512 algorithms. Fixes:a479f103dc
("hash: Allow for SHA512 hardware implementations") Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
700f68c354
commit
e2ae483c3b
|
@ -260,12 +260,12 @@ static struct hash_algo hash_algo[] = {
|
||||||
.name = "sha384",
|
.name = "sha384",
|
||||||
.digest_size = SHA384_SUM_LEN,
|
.digest_size = SHA384_SUM_LEN,
|
||||||
.chunk_size = CHUNKSZ_SHA384,
|
.chunk_size = CHUNKSZ_SHA384,
|
||||||
#ifdef CONFIG_SHA_HW_ACCEL
|
#ifdef CONFIG_SHA512_HW_ACCEL
|
||||||
.hash_func_ws = hw_sha384,
|
.hash_func_ws = hw_sha384,
|
||||||
#else
|
#else
|
||||||
.hash_func_ws = sha384_csum_wd,
|
.hash_func_ws = sha384_csum_wd,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SHA_PROG_HW_ACCEL
|
#if defined(CONFIG_SHA512_HW_ACCEL) && defined(CONFIG_SHA_PROG_HW_ACCEL)
|
||||||
.hash_init = hw_sha_init,
|
.hash_init = hw_sha_init,
|
||||||
.hash_update = hw_sha_update,
|
.hash_update = hw_sha_update,
|
||||||
.hash_finish = hw_sha_finish,
|
.hash_finish = hw_sha_finish,
|
||||||
|
@ -281,12 +281,12 @@ static struct hash_algo hash_algo[] = {
|
||||||
.name = "sha512",
|
.name = "sha512",
|
||||||
.digest_size = SHA512_SUM_LEN,
|
.digest_size = SHA512_SUM_LEN,
|
||||||
.chunk_size = CHUNKSZ_SHA512,
|
.chunk_size = CHUNKSZ_SHA512,
|
||||||
#ifdef CONFIG_SHA_HW_ACCEL
|
#ifdef CONFIG_SHA512_HW_ACCEL
|
||||||
.hash_func_ws = hw_sha512,
|
.hash_func_ws = hw_sha512,
|
||||||
#else
|
#else
|
||||||
.hash_func_ws = sha512_csum_wd,
|
.hash_func_ws = sha512_csum_wd,
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SHA_PROG_HW_ACCEL
|
#if defined(CONFIG_SHA512_HW_ACCEL) && defined(CONFIG_SHA_PROG_HW_ACCEL)
|
||||||
.hash_init = hw_sha_init,
|
.hash_init = hw_sha_init,
|
||||||
.hash_update = hw_sha_update,
|
.hash_update = hw_sha_update,
|
||||||
.hash_finish = hw_sha_finish,
|
.hash_finish = hw_sha_finish,
|
||||||
|
|
21
lib/Kconfig
21
lib/Kconfig
|
@ -389,21 +389,32 @@ config SHA384
|
||||||
(digest).
|
(digest).
|
||||||
|
|
||||||
config SHA_HW_ACCEL
|
config SHA_HW_ACCEL
|
||||||
bool "Enable hashing using hardware"
|
bool "Enable hardware acceleration for SHA hash functions"
|
||||||
help
|
help
|
||||||
This option enables hardware acceleration for SHA hashing.
|
This option enables hardware acceleration for the SHA1 and SHA256
|
||||||
This affects the 'hash' command and also the hash_lookup_algo()
|
hashing algorithms. This affects the 'hash' command and also the
|
||||||
function.
|
hash_lookup_algo() function.
|
||||||
|
|
||||||
|
if SHA_HW_ACCEL
|
||||||
|
|
||||||
|
config SHA512_HW_ACCEL
|
||||||
|
bool "Enable hardware acceleration for SHA512"
|
||||||
|
depends on SHA512_ALGO
|
||||||
|
help
|
||||||
|
This option enables hardware acceleration for the SHA384 and SHA512
|
||||||
|
hashing algorithms. This affects the 'hash' command and also the
|
||||||
|
hash_lookup_algo() function.
|
||||||
|
|
||||||
config SHA_PROG_HW_ACCEL
|
config SHA_PROG_HW_ACCEL
|
||||||
bool "Enable Progressive hashing support using hardware"
|
bool "Enable Progressive hashing support using hardware"
|
||||||
depends on SHA_HW_ACCEL
|
|
||||||
help
|
help
|
||||||
This option enables hardware-acceleration for SHA progressive
|
This option enables hardware-acceleration for SHA progressive
|
||||||
hashing.
|
hashing.
|
||||||
Data can be streamed in a block at a time and the hashing is
|
Data can be streamed in a block at a time and the hashing is
|
||||||
performed in hardware.
|
performed in hardware.
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
config MD5
|
config MD5
|
||||||
bool "Support MD5 algorithm"
|
bool "Support MD5 algorithm"
|
||||||
help
|
help
|
||||||
|
|
Loading…
Reference in New Issue
Block a user