From 82bea41f492aff12660118a479916edea5105675 Mon Sep 17 00:00:00 2001 From: Vadim Sukhomlinov Date: Fri, 10 Sep 2021 13:46:24 -0700 Subject: cr50: remove unused DCRYPTO_ladder_random() After migration to DRBG use, remove DCRYPTO_ladder_random() function. BUG=none TEST=make buildall -j Signed-off-by: Vadim Sukhomlinov Change-Id: Ifdb3fd79ec03ac94066a91ed38b61218dbceefde Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3155295 Reviewed-by: Vadim Sukhomlinov Reviewed-by: Mary Ruthven Tested-by: Vadim Sukhomlinov Commit-Queue: Vadim Sukhomlinov --- board/cr50/dcrypto/dcrypto.h | 1 - board/cr50/dcrypto/key_ladder.c | 22 ---------------------- 2 files changed, 23 deletions(-) diff --git a/board/cr50/dcrypto/dcrypto.h b/board/cr50/dcrypto/dcrypto.h index 760d388404..318a58e4e7 100644 --- a/board/cr50/dcrypto/dcrypto.h +++ b/board/cr50/dcrypto/dcrypto.h @@ -397,7 +397,6 @@ struct APPKEY_CTX { }; int DCRYPTO_ladder_compute_frk2(size_t major_fw_version, uint8_t *frk2); -int DCRYPTO_ladder_random(void *output); void DCRYPTO_ladder_revoke(void); int DCRYPTO_appkey_init(enum dcrypto_appid id, struct APPKEY_CTX *ctx); diff --git a/board/cr50/dcrypto/key_ladder.c b/board/cr50/dcrypto/key_ladder.c index 77055e4159..31844736bc 100644 --- a/board/cr50/dcrypto/key_ladder.c +++ b/board/cr50/dcrypto/key_ladder.c @@ -231,28 +231,6 @@ static void ladder_out(uint32_t output[8]) output[7] = GREG32(KEYMGR, SHA_STS_H7); } -/* - * Stir TRNG entropy into RSR and pull some out. - */ -int DCRYPTO_ladder_random(void *output) -{ - int error = 1; - uint32_t tmp[8]; - - if (!dcrypto_grab_sha_hw()) - goto fail; - - rand_bytes(tmp, sizeof(tmp)); - /* Mix TRNG bytes with RSR entropy */ - error = ladder_step(KEYMGR_CERT_27, tmp); - if (!error) - ladder_out(output); - -fail: - dcrypto_release_sha_hw(); - return !error; -} - int dcrypto_ladder_derive(enum dcrypto_appid appid, const uint32_t salt[8], const uint32_t input[8], uint32_t output[8]) { -- cgit v1.2.1