diff options
author | Raymond Mao <raymond.mao@linaro.org> | 2024-10-03 14:50:18 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-10-14 17:58:30 -0600 |
commit | 988e749d9770bad0a8d8fbf45bfa8af3ca88da38 (patch) | |
tree | 0944f9741626c7bdef0a7d46fcb4b380760846ce /lib | |
parent | 2b6f572958f3e4ab0f5b9dde64dce6ddd477fdab (diff) |
sha1: Remove sha1 non-watchdog API
We don't need an API specially for non-watchdog since sha1_csum_wd
supports it by disabling CONFIG_HW_WATCHDOG and CONFIG_WATCHDOG.
Set 0x10000 as default chunk size for SHA1.
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sha1.c | 13 | ||||
-rw-r--r-- | lib/tpm-v1.c | 2 |
2 files changed, 1 insertions, 14 deletions
diff --git a/lib/sha1.c b/lib/sha1.c index 7ef536f4b5d..81412283b49 100644 --- a/lib/sha1.c +++ b/lib/sha1.c @@ -305,19 +305,6 @@ void sha1_finish (sha1_context * ctx, unsigned char output[20]) } /* - * Output = SHA-1( input buffer ) - */ -void sha1_csum(const unsigned char *input, unsigned int ilen, - unsigned char *output) -{ - sha1_context ctx; - - sha1_starts (&ctx); - sha1_update (&ctx, input, ilen); - sha1_finish (&ctx, output); -} - -/* * Output = SHA-1( input buffer ). Trigger the watchdog every 'chunk_sz' * bytes of input processed. */ diff --git a/lib/tpm-v1.c b/lib/tpm-v1.c index e66023da5e6..a6727c575fd 100644 --- a/lib/tpm-v1.c +++ b/lib/tpm-v1.c @@ -871,7 +871,7 @@ u32 tpm1_find_key_sha1(struct udevice *dev, const u8 auth[20], return -1; if (err) continue; - sha1_csum(buf, buf_len, digest); + sha1_csum_wd(buf, buf_len, digest, SHA1_DEF_CHUNK_SZ); if (!memcmp(digest, pubkey_digest, 20)) { *handle = key_handles[i]; return 0; |