Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .wolfssl_known_macro_extras
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,7 @@ WOLFSSL_STSAFE_TAKES_SLOT
WOLFSSL_TELIT_M2MB
WOLFSSL_TEMPLATE_EXAMPLE
WOLFSSL_THREADED_CRYPT
WOLFSSL_TI_AM64X
WOLFSSL_TICKET_DECRYPT_NO_CREATE
WOLFSSL_TICKET_ENC_AES128_GCM
WOLFSSL_TICKET_ENC_AES256_CBC
Expand Down
22 changes: 18 additions & 4 deletions wolfcrypt/benchmark/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@
#endif
#endif

#ifdef WOLFSSL_TI_AM64X
#include <wolfssl/wolfcrypt/port/ti/ti-sa2ul_port.h>
#endif

#ifdef WOLFSSL_ASYNC_CRYPT
#include <wolfssl/wolfcrypt/async.h>
#endif
Expand Down Expand Up @@ -721,6 +725,10 @@ static WC_INLINE void bench_append_memory_info(char* buffer, size_t size,
#define fprintf(fp, ...) \
__android_log_print(ANDROID_LOG_DEBUG, "[WOLFCRYPT]", __VA_ARGS__)

#elif defined(TI_MCU_PLUS_SDK)
#include "kernel/nortos/dpl/common/printf.h"
#define printf printf_

#else
#if defined(XMALLOC_USER) || defined(FREESCALE_MQX)
/* MQX classic needs for EXIT_FAILURE */
Expand Down Expand Up @@ -2536,7 +2544,11 @@ static void benchmark_static_init(int force)
bench_pq_asym_algs = 0;
bench_other_algs = 0;
bench_pq_hash_sig_algs = 0;
#ifdef WOLFSSL_BENCHMARK_FIXED_CSV
csv_format = 1;
#else
csv_format = 0;
#endif
}
}

Expand Down Expand Up @@ -8179,13 +8191,15 @@ void bench_sha256(int useDeviceID)
printf("InitSha256_ex failed, ret = %d\n", ret);
goto exit;
}
#ifdef WOLFSSL_PIC32MZ_HASH
wc_Sha256SizeSet(hash[i], numBlocks * bench_size);
#endif
}

bench_stats_start(&count, &start);
do {
#ifdef WOLFSSL_PIC32MZ_HASH
for (i = 0; i < BENCH_MAX_PENDING; i++) {
wc_Sha256SizeSet(hash[i], numBlocks * bench_size);
}
#endif
for (times = 0; times < numBlocks || pending > 0; ) {
bench_async_poll(&pending);

Expand Down Expand Up @@ -18309,7 +18323,7 @@ int wolfcrypt_benchmark_main(int argc, char** argv)
argc--;
argv++;
}
#endif /* MAIN_NO_ARGS */
#endif /* !MAIN_NO_ARGS */

#if defined(WOLFSSL_BENCHMARK_FIXED_CSV)
/* when defined, we'll always output CSV regardless of params.
Expand Down
14 changes: 4 additions & 10 deletions wolfcrypt/src/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3449,9 +3449,6 @@ WC_ALL_ARGS_NOT_NULL static WARN_UNUSED_RESULT int wc_AesEncrypt(
{
#if defined(MAX3266X_AES)
word32 keySize;
#endif
#if defined(MAX3266X_CB)
int ret_cb;
#endif
word32 r;

Expand Down Expand Up @@ -3584,12 +3581,12 @@ WC_ALL_ARGS_NOT_NULL static WARN_UNUSED_RESULT int wc_AesEncrypt(
outBlock, (unsigned int)keySize);
}
#endif
#if defined(MAX3266X_CB) && defined(HAVE_AES_ECB) /* Can do a basic ECB block */
#if (defined(WOLFSSL_TI_AM64X) || defined(MAX3266X_CB)) && defined(HAVE_AES_ECB)
#ifndef WOLF_CRYPTO_CB_FIND
if (aes->devId != INVALID_DEVID)
#endif
{
ret_cb = wc_CryptoCb_AesEcbEncrypt(aes, outBlock, inBlock,
int ret_cb = wc_CryptoCb_AesEcbEncrypt(aes, outBlock, inBlock,
WC_AES_BLOCK_SIZE);
if (ret_cb != WC_NO_ERR_TRACE(CRYPTOCB_UNAVAILABLE))
return ret_cb;
Expand Down Expand Up @@ -4301,9 +4298,6 @@ WC_ALL_ARGS_NOT_NULL static WARN_UNUSED_RESULT int wc_AesDecrypt(
{
#if defined(MAX3266X_AES)
word32 keySize;
#endif
#if defined(MAX3266X_CB)
int ret_cb;
#endif
word32 r;

Expand Down Expand Up @@ -4410,12 +4404,12 @@ WC_ALL_ARGS_NOT_NULL static WARN_UNUSED_RESULT int wc_AesDecrypt(
}
#endif

#if defined(MAX3266X_CB) && defined(HAVE_AES_ECB) /* Can do a basic ECB block */
#if (defined(WOLFSSL_TI_AM64X) || defined(MAX3266X_CB)) && defined(HAVE_AES_ECB)
#ifndef WOLF_CRYPTO_CB_FIND
if (aes->devId != INVALID_DEVID)
#endif
{
ret_cb = wc_CryptoCb_AesEcbDecrypt(aes, outBlock, inBlock,
int ret_cb = wc_CryptoCb_AesEcbDecrypt(aes, outBlock, inBlock,
WC_AES_BLOCK_SIZE);
if (ret_cb != WC_NO_ERR_TRACE(CRYPTOCB_UNAVAILABLE))
return ret_cb;
Expand Down
4 changes: 4 additions & 0 deletions wolfcrypt/src/ecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4373,6 +4373,10 @@ int wc_ecc_get_curve_size_from_id(int curve_id)
return ecc_sets[curve_idx].size;
}

#ifndef strcasecmp
int strcasecmp(const char *s1, const char *s2);
#endif

/* Returns the curve index that corresponds to a given curve name in
* ecc_sets[] of ecc.c
*
Expand Down
1 change: 1 addition & 0 deletions wolfcrypt/src/include.am
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ EXTRA_DIST += wolfcrypt/src/port/ti/ti-aes.c \
wolfcrypt/src/port/ti/ti-des3.c \
wolfcrypt/src/port/ti/ti-hash.c \
wolfcrypt/src/port/ti/ti-ccm.c \
wolfcrypt/src/port/ti/ti-sa2ul_port.c \
wolfcrypt/src/port/pic32/pic32mz-crypt.c \
wolfcrypt/src/port/nrf51.c \
wolfcrypt/src/port/aria/aria-crypt.c \
Expand Down
Loading
Loading