mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Support for STM32L5 PKA ECC sign/verify acceleration.
This commit is contained in:
@ -64,6 +64,7 @@ extern "C" {
|
|||||||
//#define NO_STM32_HASH
|
//#define NO_STM32_HASH
|
||||||
//#define NO_STM32_RNG
|
//#define NO_STM32_RNG
|
||||||
//#define NO_STM32_CRYPTO
|
//#define NO_STM32_CRYPTO
|
||||||
|
//#define WOLFSSL_STM32_PKA /* WB55 and L5 only */
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
|
@ -363,9 +363,14 @@ int wc_Stm32_Aes_Init(Aes* aes, CRYP_InitTypeDef* cryptInit,
|
|||||||
|
|
||||||
#ifdef WOLFSSL_STM32_PKA
|
#ifdef WOLFSSL_STM32_PKA
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#if defined(WOLFSSL_STM32L5)
|
||||||
|
#include <stm32l5xx_hal_conf.h>
|
||||||
|
#include <stm32l5xx_hal_pka.h>
|
||||||
|
#else
|
||||||
#include <stm32wbxx_hal_conf.h>
|
#include <stm32wbxx_hal_conf.h>
|
||||||
#include <stm32wbxx_hal_pka.h>
|
#include <stm32wbxx_hal_pka.h>
|
||||||
|
#endif
|
||||||
extern PKA_HandleTypeDef hpka;
|
extern PKA_HandleTypeDef hpka;
|
||||||
|
|
||||||
/* Reverse array in memory (in place) */
|
/* Reverse array in memory (in place) */
|
||||||
|
@ -28,11 +28,6 @@
|
|||||||
#include <wolfssl/wolfcrypt/settings.h>
|
#include <wolfssl/wolfcrypt/settings.h>
|
||||||
#include <wolfssl/wolfcrypt/types.h>
|
#include <wolfssl/wolfcrypt/types.h>
|
||||||
|
|
||||||
#if defined(WOLFSSL_STM32_PKA) && defined(HAVE_ECC)
|
|
||||||
#include <wolfssl/wolfcrypt/integer.h>
|
|
||||||
#include <wolfssl/wolfcrypt/ecc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef STM32_HASH
|
#ifdef STM32_HASH
|
||||||
|
|
||||||
#define WOLFSSL_NO_HASH_RAW
|
#define WOLFSSL_NO_HASH_RAW
|
||||||
@ -139,12 +134,25 @@ int wc_Stm32_Hash_Final(STM32_HASH_Context* stmCtx, word32 algo,
|
|||||||
#endif /* STM32_CRYPTO */
|
#endif /* STM32_CRYPTO */
|
||||||
|
|
||||||
#if defined(WOLFSSL_STM32_PKA) && defined(HAVE_ECC)
|
#if defined(WOLFSSL_STM32_PKA) && defined(HAVE_ECC)
|
||||||
int stm32_ecc_verify_hash_ex(mp_int *r, mp_int *s, const byte* hash,
|
#ifdef WOLFSSL_SP_MATH
|
||||||
word32 hashlen, int* res, ecc_key* key);
|
struct sp_int;
|
||||||
|
#define MATH_INT_T struct sp_int
|
||||||
int stm32_ecc_sign_hash_ex(const byte* hash, word32 hashlen, WC_RNG* rng,
|
#elif defined(USE_FAST_MATH)
|
||||||
ecc_key* key, mp_int *r, mp_int *s);
|
struct fp_int;
|
||||||
|
#define MATH_INT_T struct fp_int
|
||||||
|
#else
|
||||||
|
struct mp_int;
|
||||||
|
#define MATH_INT_T struct mp_int
|
||||||
#endif
|
#endif
|
||||||
|
struct ecc_key;
|
||||||
|
struct WC_RNG;
|
||||||
|
|
||||||
|
int stm32_ecc_verify_hash_ex(MATH_INT_T *r, MATH_INT_T *s, const byte* hash,
|
||||||
|
word32 hashlen, int* res, struct ecc_key* key);
|
||||||
|
|
||||||
|
int stm32_ecc_sign_hash_ex(const byte* hash, word32 hashlen, struct WC_RNG* rng,
|
||||||
|
struct ecc_key* key, MATH_INT_T *r, MATH_INT_T *s);
|
||||||
|
#endif /* WOLFSSL_STM32_PKA && HAVE_ECC */
|
||||||
|
|
||||||
|
|
||||||
#endif /* _WOLFPORT_STM32_H_ */
|
#endif /* _WOLFPORT_STM32_H_ */
|
||||||
|
Reference in New Issue
Block a user