From e791b78d23c70800b3c2714d4fc0552414195816 Mon Sep 17 00:00:00 2001 From: David Garske Date: Wed, 26 Aug 2020 11:17:17 -0700 Subject: [PATCH] Fix to add wrapper for new timing resistant `wc_ecc_mulmod_ex2` function version in HW ECC acceleration. Broken in PR #2982. --- wolfcrypt/src/port/nxp/ksdk_port.c | 9 +++++++++ wolfcrypt/src/port/st/stm32.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/wolfcrypt/src/port/nxp/ksdk_port.c b/wolfcrypt/src/port/nxp/ksdk_port.c index 7036f51e8..dd8a88098 100644 --- a/wolfcrypt/src/port/nxp/ksdk_port.c +++ b/wolfcrypt/src/port/nxp/ksdk_port.c @@ -768,6 +768,15 @@ int wc_ecc_mulmod_ex(mp_int *k, ecc_point *G, ecc_point *R, mp_int* a, return res; } +int wc_ecc_mulmod_ex2(mp_int* k, ecc_point *G, ecc_point *R, mp_int* a, + mp_int* modulus, mp_int* order, WC_RNG* rng, int map, + void* heap) +{ + (void)order; + (void)rng; + return wc_ecc_mulmod_ex(k, G, R, a, modulus, map, heap); +} + int wc_ecc_point_add(ecc_point *mG, ecc_point *mQ, ecc_point *mR, mp_int *m) { int res; diff --git a/wolfcrypt/src/port/st/stm32.c b/wolfcrypt/src/port/st/stm32.c index 552ef454c..17778c097 100644 --- a/wolfcrypt/src/port/st/stm32.c +++ b/wolfcrypt/src/port/st/stm32.c @@ -725,6 +725,15 @@ int wc_ecc_mulmod_ex(mp_int *k, ecc_point *G, ecc_point *R, mp_int* a, return res; } +int wc_ecc_mulmod_ex2(mp_int* k, ecc_point *G, ecc_point *R, mp_int* a, + mp_int* modulus, mp_int* order, WC_RNG* rng, int map, + void* heap) +{ + (void)order; + (void)rng; + return wc_ecc_mulmod_ex(k, G, R, a, modulus, map, heap); +} + int stm32_ecc_verify_hash_ex(mp_int *r, mp_int *s, const byte* hash, word32 hashlen, int* res, ecc_key* key) {