From 03498df7a491ca3cc3593af42b98ab68c9993472 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 14 Nov 2023 12:01:35 -0800 Subject: [PATCH] Support public key computation with timing resistance. --- src/tpm2_wrap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tpm2_wrap.c b/src/tpm2_wrap.c index e1a52190..d9028da0 100644 --- a/src/tpm2_wrap.c +++ b/src/tpm2_wrap.c @@ -3211,7 +3211,11 @@ int wolfTPM2_EccKey_WolfToTpm_ex(WOLFTPM2_DEV* dev, WOLFTPM2_KEY* parentKey, rc = MEMORY_E; } if (rc == 0) { + #ifdef ECC_TIMING_RESISTANT + rc = wc_ecc_make_pub_ex(wolfKey, point, wolfKey->rng); + #else rc = wc_ecc_make_pub(wolfKey, point); + #endif if (rc == 0) rc = wc_export_int(point->x, qx, &qxSz, keySz, WC_TYPE_UNSIGNED_BIN);