forked from wolfSSL/wolfssl
Changed NXP SE050 to not use symmetric offloading by default. If desired use WOLFSSL_SE050_HASH
and WOLFSSL_SE050_CRYPT
.
This commit is contained in:
@ -1451,6 +1451,9 @@ AC_ARG_WITH([se050],
|
|||||||
# Requires AES direct
|
# Requires AES direct
|
||||||
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
|
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
|
||||||
|
|
||||||
|
# Does not support SHA2-512 224/256
|
||||||
|
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256"
|
||||||
|
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT([yes])
|
AC_MSG_RESULT([yes])
|
||||||
|
@ -68,7 +68,7 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
|
|||||||
#ifdef WOLFSSL_IMXRT_DCP
|
#ifdef WOLFSSL_IMXRT_DCP
|
||||||
#include <wolfssl/wolfcrypt/port/nxp/dcp_port.h>
|
#include <wolfssl/wolfcrypt/port/nxp/dcp_port.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef WOLFSSL_SE050
|
#if defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_CRYPT)
|
||||||
#include <wolfssl/wolfcrypt/port/nxp/se050_port.h>
|
#include <wolfssl/wolfcrypt/port/nxp/se050_port.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -867,7 +867,7 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits
|
|||||||
#elif defined(WOLFSSL_DEVCRYPTO_AES)
|
#elif defined(WOLFSSL_DEVCRYPTO_AES)
|
||||||
/* implemented in wolfcrypt/src/port/devcrypto/devcrypto_aes.c */
|
/* implemented in wolfcrypt/src/port/devcrypto/devcrypto_aes.c */
|
||||||
|
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_CRYPT)
|
||||||
static int AES_ECB_encrypt(Aes* aes, const byte* inBlock, byte* outBlock,
|
static int AES_ECB_encrypt(Aes* aes, const byte* inBlock, byte* outBlock,
|
||||||
int sz)
|
int sz)
|
||||||
{
|
{
|
||||||
@ -2598,7 +2598,7 @@ static void wc_AesDecrypt(Aes* aes, const byte* inBlock, byte* outBlock)
|
|||||||
return wc_AesSetKey(aes, userKey, keylen, iv, dir);
|
return wc_AesSetKey(aes, userKey, keylen, iv, dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_CRYPT)
|
||||||
int wc_AesSetKey(Aes* aes, const byte* userKey, word32 keylen, const byte* iv,
|
int wc_AesSetKey(Aes* aes, const byte* userKey, word32 keylen, const byte* iv,
|
||||||
int dir)
|
int dir)
|
||||||
{
|
{
|
||||||
@ -3876,7 +3876,7 @@ int wc_AesSetIV(Aes* aes, const byte* iv)
|
|||||||
#elif defined(WOLFSSL_DEVCRYPTO_CBC)
|
#elif defined(WOLFSSL_DEVCRYPTO_CBC)
|
||||||
/* implemented in wolfcrypt/src/port/devcrypt/devcrypto_aes.c */
|
/* implemented in wolfcrypt/src/port/devcrypt/devcrypto_aes.c */
|
||||||
|
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_CRYPT)
|
||||||
int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz)
|
int wc_AesCbcEncrypt(Aes* aes, byte* out, const byte* in, word32 sz)
|
||||||
{
|
{
|
||||||
return se050_aes_crypt(aes, in, out, sz, AES_ENCRYPTION,
|
return se050_aes_crypt(aes, in, out, sz, AES_ENCRYPTION,
|
||||||
@ -10363,7 +10363,7 @@ void wc_AesFree(Aes* aes)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WOLFSSL_SE050)
|
#if defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_CRYPT)
|
||||||
se050_aes_free(aes);
|
se050_aes_free(aes);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -44,6 +44,9 @@ make
|
|||||||
Where `PATH` is the directory location of `simw-top`.
|
Where `PATH` is the directory location of `simw-top`.
|
||||||
Example: `./configure --enable-debug --disable-shared --with-se050=/home/pi/simw-top CFLAGS="-DWOLFSSL_SE050_INIT"`
|
Example: `./configure --enable-debug --disable-shared --with-se050=/home/pi/simw-top CFLAGS="-DWOLFSSL_SE050_INIT"`
|
||||||
|
|
||||||
|
To enable AES Cipher support use `WOLFSSL_SE050_CRYPT`
|
||||||
|
To enable SHA-1 and SHA-2 support use `WOLFSSL_SE050_HASH`
|
||||||
|
|
||||||
## Building Examples
|
## Building Examples
|
||||||
|
|
||||||
Confirm that you are able to run the examples from the directory:
|
Confirm that you are able to run the examples from the directory:
|
||||||
|
@ -336,7 +336,7 @@
|
|||||||
#elif defined(WOLFSSL_SILABS_SE_ACCEL)
|
#elif defined(WOLFSSL_SILABS_SE_ACCEL)
|
||||||
|
|
||||||
/* implemented in wolfcrypt/src/port/silabs/silabs_hash.c */
|
/* implemented in wolfcrypt/src/port/silabs/silabs_hash.c */
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
|
|
||||||
#include <wolfssl/wolfcrypt/port/nxp/se050_port.h>
|
#include <wolfssl/wolfcrypt/port/nxp/se050_port.h>
|
||||||
int wc_InitSha_ex(wc_Sha* sha, void* heap, int devId)
|
int wc_InitSha_ex(wc_Sha* sha, void* heap, int devId)
|
||||||
@ -846,7 +846,7 @@ void wc_ShaFree(wc_Sha* sha)
|
|||||||
#ifdef WOLFSSL_PIC32MZ_HASH
|
#ifdef WOLFSSL_PIC32MZ_HASH
|
||||||
wc_ShaPic32Free(sha);
|
wc_ShaPic32Free(sha);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WOLFSSL_SE050
|
#if defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
se050_hash_free(&sha->se050Ctx);
|
se050_hash_free(&sha->se050Ctx);
|
||||||
#endif
|
#endif
|
||||||
#if (defined(WOLFSSL_RENESAS_TSIP_CRYPT) && \
|
#if (defined(WOLFSSL_RENESAS_TSIP_CRYPT) && \
|
||||||
|
@ -184,7 +184,7 @@ where 0 <= L < 2^64.
|
|||||||
(!defined(WOLFSSL_ESP32WROOM32_CRYPT) || defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH)) && \
|
(!defined(WOLFSSL_ESP32WROOM32_CRYPT) || defined(NO_WOLFSSL_ESP32WROOM32_CRYPT_HASH)) && \
|
||||||
(!defined(WOLFSSL_RENESAS_TSIP_CRYPT) || defined(NO_WOLFSSL_RENESAS_TSIP_HASH)) && \
|
(!defined(WOLFSSL_RENESAS_TSIP_CRYPT) || defined(NO_WOLFSSL_RENESAS_TSIP_HASH)) && \
|
||||||
!defined(WOLFSSL_PSOC6_CRYPTO) && !defined(WOLFSSL_IMXRT_DCP) && !defined(WOLFSSL_SILABS_SE_ACCEL) && \
|
!defined(WOLFSSL_PSOC6_CRYPTO) && !defined(WOLFSSL_IMXRT_DCP) && !defined(WOLFSSL_SILABS_SE_ACCEL) && \
|
||||||
!defined(WOLFSSL_KCAPI_HASH) && !defined(WOLFSSL_SE050)
|
!defined(WOLFSSL_KCAPI_HASH) && !defined(WOLFSSL_SE050_HASH)
|
||||||
|
|
||||||
|
|
||||||
static int InitSha256(wc_Sha256* sha256)
|
static int InitSha256(wc_Sha256* sha256)
|
||||||
@ -585,7 +585,7 @@ static int InitSha256(wc_Sha256* sha256)
|
|||||||
!defined(WOLFSSL_QNX_CAAM)
|
!defined(WOLFSSL_QNX_CAAM)
|
||||||
/* functions defined in wolfcrypt/src/port/caam/caam_sha256.c */
|
/* functions defined in wolfcrypt/src/port/caam/caam_sha256.c */
|
||||||
|
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
|
|
||||||
#include <wolfssl/wolfcrypt/port/nxp/se050_port.h>
|
#include <wolfssl/wolfcrypt/port/nxp/se050_port.h>
|
||||||
int wc_InitSha256_ex(wc_Sha256* sha256, void* heap, int devId)
|
int wc_InitSha256_ex(wc_Sha256* sha256, void* heap, int devId)
|
||||||
@ -1411,7 +1411,7 @@ static int InitSha256(wc_Sha256* sha256)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
|
|
||||||
#include <wolfssl/wolfcrypt/port/nxp/se050_port.h>
|
#include <wolfssl/wolfcrypt/port/nxp/se050_port.h>
|
||||||
int wc_InitSha224_ex(wc_Sha224* sha224, void* heap, int devId)
|
int wc_InitSha224_ex(wc_Sha224* sha224, void* heap, int devId)
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
#include <wolfssl/wolfcrypt/cryptocb.h>
|
#include <wolfssl/wolfcrypt/cryptocb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WOLFSSL_SE050
|
#if defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
#include <wolfssl/wolfcrypt/port/nxp/se050_port.h>
|
#include <wolfssl/wolfcrypt/port/nxp/se050_port.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -203,7 +203,7 @@
|
|||||||
#elif defined(WOLFSSL_KCAPI_HASH)
|
#elif defined(WOLFSSL_KCAPI_HASH)
|
||||||
/* functions defined in wolfcrypt/src/port/kcapi/kcapi_hash.c */
|
/* functions defined in wolfcrypt/src/port/kcapi/kcapi_hash.c */
|
||||||
|
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
int wc_InitSha512(wc_Sha512* sha512)
|
int wc_InitSha512(wc_Sha512* sha512)
|
||||||
{
|
{
|
||||||
if (sha512 == NULL)
|
if (sha512 == NULL)
|
||||||
@ -952,7 +952,7 @@ int wc_Sha512Update(wc_Sha512* sha512, const byte* data, word32 len)
|
|||||||
|
|
||||||
#if defined(WOLFSSL_KCAPI_HASH)
|
#if defined(WOLFSSL_KCAPI_HASH)
|
||||||
/* functions defined in wolfcrypt/src/port/kcapi/kcapi_hash.c */
|
/* functions defined in wolfcrypt/src/port/kcapi/kcapi_hash.c */
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -1063,7 +1063,7 @@ static WC_INLINE int Sha512Final(wc_Sha512* sha512)
|
|||||||
|
|
||||||
#if defined(WOLFSSL_KCAPI_HASH)
|
#if defined(WOLFSSL_KCAPI_HASH)
|
||||||
/* functions defined in wolfcrypt/src/port/kcapi/kcapi_hash.c */
|
/* functions defined in wolfcrypt/src/port/kcapi/kcapi_hash.c */
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
@ -1135,7 +1135,7 @@ int wc_Sha512Final(wc_Sha512* sha512, byte* hash)
|
|||||||
|
|
||||||
#endif /* WOLFSSL_KCAPI_HASH */
|
#endif /* WOLFSSL_KCAPI_HASH */
|
||||||
|
|
||||||
#ifndef WOLFSSL_SE050
|
#if !defined(WOLFSSL_SE050) || !defined(WOLFSSL_SE050_HASH)
|
||||||
int wc_InitSha512(wc_Sha512* sha512)
|
int wc_InitSha512(wc_Sha512* sha512)
|
||||||
{
|
{
|
||||||
return wc_InitSha512_ex(sha512, NULL, INVALID_DEVID);
|
return wc_InitSha512_ex(sha512, NULL, INVALID_DEVID);
|
||||||
@ -1217,7 +1217,7 @@ int wc_Sha512Transform(wc_Sha512* sha, const unsigned char* data)
|
|||||||
}
|
}
|
||||||
#endif /* OPENSSL_EXTRA */
|
#endif /* OPENSSL_EXTRA */
|
||||||
#endif /* WOLFSSL_SHA512 */
|
#endif /* WOLFSSL_SHA512 */
|
||||||
#endif /* !WOLFSSL_SE050 */
|
#endif /* !WOLFSSL_SE050 || !WOLFSSL_SE050_HASH */
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
@ -1228,7 +1228,7 @@ int wc_Sha512Transform(wc_Sha512* sha, const unsigned char* data)
|
|||||||
#if defined(WOLFSSL_IMX6_CAAM) && !defined(NO_IMX6_CAAM_HASH) && \
|
#if defined(WOLFSSL_IMX6_CAAM) && !defined(NO_IMX6_CAAM_HASH) && \
|
||||||
!defined(WOLFSSL_QNX_CAAM)
|
!defined(WOLFSSL_QNX_CAAM)
|
||||||
/* functions defined in wolfcrypt/src/port/caam/caam_sha.c */
|
/* functions defined in wolfcrypt/src/port/caam/caam_sha.c */
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
int wc_InitSha384_ex(wc_Sha384* sha384, void* heap, int devId)
|
int wc_InitSha384_ex(wc_Sha384* sha384, void* heap, int devId)
|
||||||
{
|
{
|
||||||
if (sha384 == NULL) {
|
if (sha384 == NULL) {
|
||||||
@ -1566,7 +1566,7 @@ int wc_Sha512_224Update(wc_Sha512* sha, const byte* data, word32 len)
|
|||||||
|
|
||||||
#if defined(WOLFSSL_KCAPI_HASH)
|
#if defined(WOLFSSL_KCAPI_HASH)
|
||||||
/* functions defined in wolfcrypt/src/port/kcapi/kcapi_hash.c */
|
/* functions defined in wolfcrypt/src/port/kcapi/kcapi_hash.c */
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
int wc_Sha512_224FinalRaw(wc_Sha512* sha, byte* hash)
|
int wc_Sha512_224FinalRaw(wc_Sha512* sha, byte* hash)
|
||||||
@ -1585,7 +1585,7 @@ void wc_Sha512_224Free(wc_Sha512* sha)
|
|||||||
}
|
}
|
||||||
#if defined(WOLFSSL_KCAPI_HASH)
|
#if defined(WOLFSSL_KCAPI_HASH)
|
||||||
/* functions defined in wolfcrypt/src/port/kcapi/kcapi_hash.c */
|
/* functions defined in wolfcrypt/src/port/kcapi/kcapi_hash.c */
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@ -1630,7 +1630,7 @@ int wc_Sha512_256Update(wc_Sha512* sha, const byte* data, word32 len)
|
|||||||
}
|
}
|
||||||
#if defined(WOLFSSL_KCAPI_HASH)
|
#if defined(WOLFSSL_KCAPI_HASH)
|
||||||
/* functions defined in wolfcrypt/src/port/kcapi/kcapi_hash.c */
|
/* functions defined in wolfcrypt/src/port/kcapi/kcapi_hash.c */
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
int wc_Sha512_256FinalRaw(wc_Sha512* sha, byte* hash)
|
int wc_Sha512_256FinalRaw(wc_Sha512* sha, byte* hash)
|
||||||
|
@ -110,7 +110,7 @@ enum {
|
|||||||
#include "wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h"
|
#include "wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h"
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if defined(WOLFSSL_SE050)
|
#if defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
#include "wolfssl/wolfcrypt/port/nxp/se050_port.h"
|
#include "wolfssl/wolfcrypt/port/nxp/se050_port.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ enum {
|
|||||||
struct wc_Sha {
|
struct wc_Sha {
|
||||||
#ifdef FREESCALE_LTC_SHA
|
#ifdef FREESCALE_LTC_SHA
|
||||||
ltc_hash_ctx_t ctx;
|
ltc_hash_ctx_t ctx;
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
SE050_HASH_Context se050Ctx;
|
SE050_HASH_Context se050Ctx;
|
||||||
#elif defined(STM32_HASH)
|
#elif defined(STM32_HASH)
|
||||||
STM32_HASH_Context stmCtx;
|
STM32_HASH_Context stmCtx;
|
||||||
|
@ -144,7 +144,7 @@ enum {
|
|||||||
#include "wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h"
|
#include "wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h"
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if defined(WOLFSSL_SE050)
|
#if defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
#include "wolfssl/wolfcrypt/port/nxp/se050_port.h"
|
#include "wolfssl/wolfcrypt/port/nxp/se050_port.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ enum {
|
|||||||
struct wc_Sha256 {
|
struct wc_Sha256 {
|
||||||
#ifdef FREESCALE_LTC_SHA
|
#ifdef FREESCALE_LTC_SHA
|
||||||
ltc_hash_ctx_t ctx;
|
ltc_hash_ctx_t ctx;
|
||||||
#elif defined(WOLFSSL_SE050)
|
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
|
||||||
SE050_HASH_Context se050Ctx;
|
SE050_HASH_Context se050Ctx;
|
||||||
#elif defined(STM32_HASH_SHA2)
|
#elif defined(STM32_HASH_SHA2)
|
||||||
STM32_HASH_Context stmCtx;
|
STM32_HASH_Context stmCtx;
|
||||||
|
Reference in New Issue
Block a user