From 67d0a801875f143df2ce8584b1c49e93e4467e76 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Thu, 17 Feb 2022 18:12:01 -0800 Subject: scribe: fix build failures Scribe code is not compiled often, it has bitrot a bit due to tool upgrades. This patch restores the scribe build correctness. BUG=none TEST=scribe build does not fail any more. Signed-off-by: Vadim Bendebury Change-Id: I335c7903258b14ff731e7c345a36194395baf5d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3668651 Tested-by: Vadim Bendebury Reviewed-by: Vadim Sukhomlinov Commit-Queue: Vadim Bendebury --- chip/g/dcrypto/dcrypto_bn.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/chip/g/dcrypto/dcrypto_bn.c b/chip/g/dcrypto/dcrypto_bn.c index b8f8fef4f4..76801773b0 100644 --- a/chip/g/dcrypto/dcrypto_bn.c +++ b/chip/g/dcrypto/dcrypto_bn.c @@ -1275,6 +1275,8 @@ int dcrypto_modexp_blinded(struct LITE_BIGNUM *output, uint32_t r_buf[RSA_MAX_WORDS]; uint32_t rinv_buf[RSA_MAX_WORDS]; + uint32_t rx[2]; + struct LITE_BIGNUM r; struct LITE_BIGNUM rinv; @@ -1302,7 +1304,10 @@ int dcrypto_modexp_blinded(struct LITE_BIGNUM *output, result = setup_and_lock(N, input); /* Pick !0 64-bit random for exponent blinding */ - rand64(ctx->rnd); + rand64(rx); + ctx->rnd[0] = rx[0]; + ctx->rnd[1] = rx[1]; + ctx->pubexp = pubexp; ctx->_pad1[0] = ctx->_pad1[1] = ctx->_pad1[2] = 0; -- cgit v1.2.1