From 3465a487d327e4088133cd1f6f3b85933b8898db Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Wed, 9 Oct 2019 10:22:04 +0200 Subject: [PATCH] STM32 PKA fix: remove reverse array operations --- wolfcrypt/src/port/st/stm32.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/wolfcrypt/src/port/st/stm32.c b/wolfcrypt/src/port/st/stm32.c index 891c30e48..7459eeef3 100644 --- a/wolfcrypt/src/port/st/stm32.c +++ b/wolfcrypt/src/port/st/stm32.c @@ -370,20 +370,6 @@ int wc_Stm32_Aes_Init(Aes* aes, CRYP_InitTypeDef* cryptInit, extern PKA_HandleTypeDef hpka; /* Reverse array in memory (in place) */ -static void stm32_reverse_array(uint8_t *src, size_t src_len) -{ - unsigned int i; - - for (i = 0; i < src_len / 2; i++) { - uint8_t tmp; - - tmp = src[i]; - src[i] = src[src_len - 1 - i]; - src[src_len - 1 - i] = tmp; - } -} - - #ifdef HAVE_ECC #include @@ -415,12 +401,6 @@ static int stm32_get_from_mp_int(uint8_t *dst, mp_int *a, int sz) /* convert mp_int to array of bytes */ res = mp_to_unsigned_bin(a, dst + offset); - - if (res == MP_OKAY) { - /* reverse array for STM32_PKA direct use */ - stm32_reverse_array(dst, sz); - } - return res; }