diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/Kconfig | 8 | ||||
-rw-r--r-- | common/hash.c | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/common/Kconfig b/common/Kconfig index e8d89bf6eb9..0e8c44f3f74 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -845,6 +845,14 @@ config HASH and the algorithms it supports are defined in common/hash.c. See also CMD_HASH for command-line access. +config HASH_CRC8 + bool "Make crc8 available via the hash API" + depends on HASH && CRC8 + help + Most times, the crc8() function is called directly. To make it also + available via the hash API, e.g. in hash_block(), enable this + option. + config AVB_VERIFY bool "Build Android Verified Boot operations" depends on LIBAVB diff --git a/common/hash.c b/common/hash.c index db6925d6782..8dd9da85768 100644 --- a/common/hash.c +++ b/common/hash.c @@ -304,6 +304,14 @@ static struct hash_algo hash_algo[] = { .hash_update = hash_update_crc16_ccitt, .hash_finish = hash_finish_crc16_ccitt, }, +#if CONFIG_IS_ENABLED(CRC8) && IS_ENABLED(CONFIG_HASH_CRC8) + { + .name = "crc8", + .digest_size = 1, + .chunk_size = CHUNKSZ_CRC32, + .hash_func_ws = crc8_wd_buf, + }, +#endif #if CONFIG_IS_ENABLED(CRC32) { .name = "crc32", |