add the STM32 peripheral clock enable and disable

calls to the benchmark program so the benchmark program can use hardware accleration
pull/6289/head
John Bland 2023-04-11 13:58:50 -04:00
parent d9d9c5cd3d
commit fbadcf67da
1 changed files with 10 additions and 0 deletions

View File

@ -2941,6 +2941,11 @@ int benchmark_init(void)
benchmark_static_init(0);
#ifdef WOLFSSL_STM32_CUBEMX
/* enable the peripheral clock */
__HAL_RCC_CRYP_CLK_ENABLE();
#endif
#ifdef WOLFSSL_STATIC_MEMORY
ret = wc_LoadStaticMemory(&HEAP_HINT, gBenchMemory,
sizeof(gBenchMemory), WOLFMEM_GENERAL, 1);
@ -3049,6 +3054,11 @@ int benchmark_free(void)
printf("%serror %d with wolfCrypt_Cleanup\n", err_prefix, ret);
}
#ifdef WOLFSSL_STM32_CUBEMX
/* disable the peripheral clock */
__HAL_RCC_CRYP_CLK_DISABLE();
#endif
return ret;
}