From f4e258d1963a26fbee847fd0a270b1e03e5e9add Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Wed, 4 May 2022 16:12:59 +0200 Subject: [PATCH 1/4] Generic changes * fix compilation warning * adjust SHA3-384 test error-codes The way the codes were constructed before, they were not unique. * unify code Instead of having `ifdef`'s in the code, define our own wrapper around the keysource as required. * add CMake option for help-text in wolfCrypt tests * expose test `main()` as `wolfcrypt_test_main()` * Don't overwrite previously set errors * add FreeRTOS support for Xilinx demo * move `fp_reverse` from `tfm.c` to `wolfmath.c` and rename to `mp_reverse`. Signed-off-by: Steffen Jaeckel --- CMakeLists.txt | 10 +++++++++ IDE/XilinxSDK/user_settings.h | 2 ++ IDE/XilinxSDK/wolfssl_example.c | 40 ++++++++++++++++++++++++++++++++- wolfcrypt/src/aes.c | 6 ++--- wolfcrypt/src/signature.c | 6 +++-- wolfcrypt/src/tfm.c | 23 +++---------------- wolfcrypt/src/wolfmath.c | 20 +++++++++++++++++ wolfcrypt/test/test.c | 17 +++++++++----- wolfcrypt/test/test.h | 3 +++ wolfssl/wolfcrypt/aes.h | 9 +++++++- wolfssl/wolfcrypt/tfm.h | 1 - wolfssl/wolfcrypt/wc_port.h | 1 + wolfssl/wolfcrypt/wolfmath.h | 1 + 13 files changed, 105 insertions(+), 34 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91605ca6e..a580b7e64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1563,6 +1563,10 @@ add_option("WOLFSSL_CRYPT_TESTS_LIBS" "Build static libraries from the wolfCrypt test and benchmark sources (default: disabled)" "no" "yes;no") +add_option("WOLFSSL_CRYPT_TESTS_HELP" + "Add help text to wolfCrypt test (default: disabled)" + "no" "yes;no") + # TODO: - LIBZ # - PKCS#11 # - Cavium @@ -1983,6 +1987,9 @@ if(WOLFSSL_CRYPT_TESTS) set_target_properties(wolfcrypttest_lib PROPERTIES OUTPUT_NAME "wolfcrypttest") target_link_libraries(wolfcrypttest_lib wolfssl) target_compile_options(wolfcrypttest_lib PRIVATE "-DNO_MAIN_DRIVER") + if(WOLFSSL_CRYPT_TESTS_HELP) + target_compile_options(wolfcrypttest_lib PRIVATE "-DHAVE_WOLFCRYPT_TEST_OPTIONS") + endif() # Make another library for the wolfCrypt benchmark code. add_library(wolfcryptbench_lib @@ -2002,6 +2009,9 @@ if(WOLFSSL_CRYPT_TESTS) set_property(TARGET wolfcrypttest PROPERTY RUNTIME_OUTPUT_NAME testwolfcrypt) + if(WOLFSSL_CRYPT_TESTS_HELP) + target_compile_options(wolfcrypttest PRIVATE "-DHAVE_WOLFCRYPT_TEST_OPTIONS") + endif() # Build wolfCrypt benchmark executable. add_executable(wolfcryptbench diff --git a/IDE/XilinxSDK/user_settings.h b/IDE/XilinxSDK/user_settings.h index 9138f81f3..1cb5644e2 100644 --- a/IDE/XilinxSDK/user_settings.h +++ b/IDE/XilinxSDK/user_settings.h @@ -37,7 +37,9 @@ /* Xilinx SDK */ #define WOLFSSL_XILINX +#ifndef FREERTOS #define SINGLE_THREADED +#endif #define NO_FILESYSTEM /* Platform - remap printf */ diff --git a/IDE/XilinxSDK/wolfssl_example.c b/IDE/XilinxSDK/wolfssl_example.c index 2c6518c3f..1b21c03e2 100644 --- a/IDE/XilinxSDK/wolfssl_example.c +++ b/IDE/XilinxSDK/wolfssl_example.c @@ -22,6 +22,14 @@ #include "xil_printf.h" #include "xrtcpsu.h" +#ifdef FREERTOS +/* FreeRTOS includes. */ +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" +#include "timers.h" +#endif + #include "wolfssl/wolfcrypt/settings.h" #include "wolfssl/wolfcrypt/wc_port.h" #include "wolfssl/wolfcrypt/error-crypt.h" @@ -64,7 +72,36 @@ unsigned char my_rng_seed_gen(void) /***************************************************************************** * Public functions ****************************************************************************/ +#ifdef FREERTOS + +static void wolfssl_task( void *pvParameters ); +static TaskHandle_t xWolfsslTask; + +int main( void ) +{ + xTaskCreate(wolfssl_task, /* The function that implements the task. */ + (const char*) "Tx", /* Text name for the task, provided to assist debugging only. */ + configMINIMAL_STACK_SIZE, /* The stack allocated to the task. */ + NULL, /* The task parameter is not used, so set to NULL. */ + tskIDLE_PRIORITY, /* The task runs at the idle priority. */ + &xWolfsslTask); + + /* Start the task. */ + vTaskStartScheduler(); + + /* If all is well, the scheduler will now be running, and the following line + will never be reached. If the following line does execute, then there was + insufficient FreeRTOS heap memory available for the idle and/or timer tasks + to be created. See the memory management section on the FreeRTOS web site + for more details. */ + for (;;) + ; +} + +static void wolfssl_task( void *pvParameters ) +#else int main() +#endif { uint8_t cmd; func_args args; @@ -114,6 +151,7 @@ int main() } wolfCrypt_Cleanup(); - +#ifndef FREERTOS return 0; +#endif } diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 0586a733e..a4ab8c1e0 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -4820,10 +4820,8 @@ int wc_AesGcmSetKey(Aes* aes, const byte* key, word32 len) } #endif /* FREESCALE_LTC_AES_GCM */ -#if defined(WOLFSSL_XILINX_CRYPT) - wc_AesGcmSetKey_ex(aes, key, len, XSECURE_CSU_AES_KEY_SRC_KUP); -#elif defined(WOLFSSL_AFALG_XILINX_AES) - wc_AesGcmSetKey_ex(aes, key, len, 0); +#if defined(WOLFSSL_XILINX_CRYPT) || defined(WOLFSSL_AFALG_XILINX_AES) + wc_AesGcmSetKey_ex(aes, key, len, WOLFSSL_XILINX_AES_KEY_SRC); #endif #ifdef WOLF_CRYPTO_CB diff --git a/wolfcrypt/src/signature.c b/wolfcrypt/src/signature.c index fe2229029..c880abf07 100644 --- a/wolfcrypt/src/signature.c +++ b/wolfcrypt/src/signature.c @@ -192,6 +192,9 @@ int wc_SignatureVerifyHash( ret = cc310_RsaSSL_Verify(hash_data, hash_len, (byte*)sig, (RsaKey*)key, cc310_hashModeRSA(hash_type, 1)); } + if (ret != 0) { + ret = SIG_VERIFY_E; + } #else word32 plain_len = hash_len; @@ -242,8 +245,7 @@ int wc_SignatureVerifyHash( } #endif /* WOLFSSL_CRYPTOCELL */ if (ret != 0) { - WOLFSSL_MSG("RSA Signature Verify difference!"); - ret = SIG_VERIFY_E; + WOLFSSL_MSG("RSA Signature Verify failed!"); } #else ret = SIG_TYPE_E; diff --git a/wolfcrypt/src/tfm.c b/wolfcrypt/src/tfm.c index 4bfcdd7c6..28beee6c1 100644 --- a/wolfcrypt/src/tfm.c +++ b/wolfcrypt/src/tfm.c @@ -3810,7 +3810,7 @@ int fp_to_unsigned_bin(fp_int *a, unsigned char *b) fp_init_copy(t, a); x = fp_to_unsigned_bin_at_pos(0, t, b); - fp_reverse (b, x); + mp_reverse (b, x); #ifdef WOLFSSL_SMALL_STACK XFREE(t, NULL, DYNAMIC_TYPE_BIGINT); @@ -3856,7 +3856,7 @@ int fp_to_unsigned_bin_len(fp_int *a, unsigned char *b, int c) b[x] = (unsigned char) (t->dp[0] & 255); fp_div_2d (t, 8, t, NULL); } - fp_reverse (b, x); + mp_reverse (b, x); #ifdef WOLFSSL_SMALL_STACK XFREE(t, NULL, DYNAMIC_TYPE_BIGINT); @@ -4106,23 +4106,6 @@ void fp_rshd(fp_int *a, int x) fp_clamp(a); } -/* reverse an array, used for radix code */ -void fp_reverse (unsigned char *s, int len) -{ - int ix, iy; - unsigned char t; - - ix = 0; - iy = len - 1; - while (ix < iy) { - t = s[ix]; - s[ix] = s[iy]; - s[iy] = t; - ++ix; - --iy; - } -} - /* c = a - b */ int fp_sub_d(fp_int *a, fp_digit b, fp_int *c) @@ -5848,7 +5831,7 @@ int mp_toradix (mp_int *a, char *str, int radix) /* reverse the digits of the string. In this case _s points * to the first digit [excluding the sign] of the number] */ - fp_reverse ((unsigned char *)_s, digs); + mp_reverse ((unsigned char *)_s, digs); /* append a NULL so the string is properly terminated */ *str = '\0'; diff --git a/wolfcrypt/src/wolfmath.c b/wolfcrypt/src/wolfmath.c index 78a77bafb..3687e0ca7 100644 --- a/wolfcrypt/src/wolfmath.c +++ b/wolfcrypt/src/wolfmath.c @@ -71,6 +71,26 @@ #endif +/* reverse an array, used for radix code */ +void mp_reverse (unsigned char *s, int len) +{ + int ix, iy; + unsigned char t; + + if (s == NULL) + return; + + ix = 0; + iy = len - 1; + while (ix < iy) { + t = s[ix]; + s[ix] = s[iy]; + s[iy] = t; + ++ix; + --iy; + } +} + int get_digit_count(const mp_int* a) { if (a == NULL) diff --git a/wolfcrypt/test/test.c b/wolfcrypt/test/test.c index 41e63d18c..83c9e9abf 100644 --- a/wolfcrypt/test/test.c +++ b/wolfcrypt/test/test.c @@ -1535,7 +1535,14 @@ options: [-s max_relative_stack_bytes] [-m max_relative_heap_memory_bytes]\n\ #if defined(WOLFSSL_ESPIDF) || defined(_WIN32_WCE) int wolf_test_task(void) #else +#ifndef NO_MAIN_FUNCTION int main(int argc, char** argv) + { + return wolfcrypt_test_main(argc, argv); + } +#endif + + int wolfcrypt_test_main(int argc, char** argv) #endif { int ret; @@ -3346,21 +3353,21 @@ static int sha3_384_test(void) ret = wc_Sha3_384_Update(&sha, (byte*)test_sha[i].input, (word32)test_sha[i].inLen); if (ret != 0) - ERROR_OUT(-2801 - i, exit); + ERROR_OUT(-2801 - (i * 10), exit); #ifndef NO_INTM_HASH_TEST ret = wc_Sha3_384_GetHash(&sha, hashcopy); if (ret != 0) - ERROR_OUT(-2802 - i, exit); + ERROR_OUT(-2802 - (i * 10), exit); #endif ret = wc_Sha3_384_Final(&sha, hash); if (ret != 0) - ERROR_OUT(-2803 - i, exit); + ERROR_OUT(-2803 - (i * 10), exit); if (XMEMCMP(hash, test_sha[i].output, WC_SHA3_384_DIGEST_SIZE) != 0) - ERROR_OUT(-2804 - i, exit); + ERROR_OUT(-2804 - (i * 10), exit); #ifndef NO_INTM_HASH_TEST if (XMEMCMP(hash, hashcopy, WC_SHA3_384_DIGEST_SIZE) != 0) - ERROR_OUT(-2805 - i, exit); + ERROR_OUT(-2805 - (i * 10), exit); #endif } diff --git a/wolfcrypt/test/test.h b/wolfcrypt/test/test.h index 3dcf9ad92..6ca21fcab 100644 --- a/wolfcrypt/test/test.h +++ b/wolfcrypt/test/test.h @@ -33,6 +33,9 @@ THREAD_RETURN WOLFSSL_THREAD wolfcrypt_test(void* args); #else int wolfcrypt_test(void* args); #endif +#ifndef NO_MAIN_DRIVER +int wolfcrypt_test_main(int argc, char** argv); +#endif #ifdef __cplusplus } /* extern "C" */ diff --git a/wolfssl/wolfcrypt/aes.h b/wolfssl/wolfcrypt/aes.h index 3de0ab4fa..9f1bd80e1 100644 --- a/wolfssl/wolfcrypt/aes.h +++ b/wolfssl/wolfcrypt/aes.h @@ -68,7 +68,14 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits #ifdef WOLFSSL_XILINX_CRYPT #include "xsecure_aes.h" -#endif +#define WOLFSSL_XILINX_AES_KEY_SRC XSECURE_CSU_AES_KEY_SRC_KUP +#endif /* WOLFSSL_XILINX_CRYPT */ + +#if defined(WOLFSSL_XILINX_CRYPT) || defined(WOLFSSL_AFALG_XILINX_AES) +#if !defined(WOLFSSL_XILINX_AES_KEY_SRC) +#define WOLFSSL_XILINX_AES_KEY_SRC 0 +#endif /* !defined(WOLFSSL_XILINX_AES_KEY_SRC) */ +#endif /* all Xilinx crypto */ #ifdef WOLFSSL_SE050 #include diff --git a/wolfssl/wolfcrypt/tfm.h b/wolfssl/wolfcrypt/tfm.h index 327bd950e..9d5bf4a1c 100644 --- a/wolfssl/wolfcrypt/tfm.h +++ b/wolfssl/wolfcrypt/tfm.h @@ -678,7 +678,6 @@ int fp_to_unsigned_bin_at_pos(int x, fp_int *t, unsigned char *b); /* VARIOUS LOW LEVEL STUFFS */ int s_fp_add(fp_int *a, fp_int *b, fp_int *c); void s_fp_sub(fp_int *a, fp_int *b, fp_int *c); -void fp_reverse(unsigned char *s, int len); int fp_mul_comba(fp_int *a, fp_int *b, fp_int *c); diff --git a/wolfssl/wolfcrypt/wc_port.h b/wolfssl/wolfcrypt/wc_port.h index e4c961d9a..a5461d776 100644 --- a/wolfssl/wolfcrypt/wc_port.h +++ b/wolfssl/wolfcrypt/wc_port.h @@ -755,6 +755,7 @@ WOLFSSL_ABI WOLFSSL_API int wolfCrypt_Cleanup(void); #define XTIME(t1) xilinx_time((t1)) #endif #include + time_t xilinx_time(time_t * timer); #elif defined(HAVE_RTP_SYS) #include "os.h" /* dc_rtc_api needs */ diff --git a/wolfssl/wolfcrypt/wolfmath.h b/wolfssl/wolfcrypt/wolfmath.h index 6a06f0ef9..c578f9b8d 100644 --- a/wolfssl/wolfcrypt/wolfmath.h +++ b/wolfssl/wolfcrypt/wolfmath.h @@ -58,6 +58,7 @@ This library provides big integer math functions. MP_API int get_digit_count(const mp_int* a); MP_API mp_digit get_digit(const mp_int* a, int n); MP_API int get_rand_digit(WC_RNG* rng, mp_digit* d); +WOLFSSL_LOCAL void mp_reverse(unsigned char *s, int len); WOLFSSL_API int mp_cond_copy(mp_int* a, int copy, mp_int* b); WOLFSSL_API int mp_rand(mp_int* a, int digits, WC_RNG* rng); From f24cf38f01d050d8f873686fb13fc6f7a447af01 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 12 May 2022 10:43:33 +0200 Subject: [PATCH 2/4] Update benchmarks * add option to run benchmarks with and w/o AAD This adds the possibility to benchmark AES-GCM and AES-CCM both with and w/o AAD, with the option to also run both. The default behavior when wolfSSL provides the `main()` function is unchanged. The default behavior when wolfSSL doesn't provide the `main()` function has been changed to "run both benchmarks - with and w/o ADD". * add option to run benchmarks against 4096bit RSA&DH keys * remove `BENCH_SIZE` macro from benchmark.c * pre-define benchmark sizes in a single place, before it had to be done in two places * improve `benchmark_static_init()` - static variable doesn't need to be in global scope - add option to force re-init - add more static variables to be reset * add `-blocks` option to benchmarks * expose benchmark `main()` as `wolfcrypt_benchmark_main()` * fix benchmark `-?` output * use correct SI/Binary prefix in benchmarks * use a separate column per detail in CSV output of benchmark * add `-aad_size` option to benchmark * don't always print symmetric CSV headers * always use M[i]B/s when output format is CSV * Versal specific patches for benchmarks This also removes the default define for `COUNTS_PER_SECOND` for Xilinx targets, since I prefer to have a build failure over wrongly calculated output. Signed-off-by: Steffen Jaeckel --- wolfcrypt/benchmark/benchmark.c | 423 +++++++++++++++++++++----------- wolfcrypt/benchmark/benchmark.h | 5 +- 2 files changed, 277 insertions(+), 151 deletions(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index f500cdbfa..366cebeeb 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -510,6 +510,20 @@ #define BENCH_RNG 0x00000001 #define BENCH_SCRYPT 0x00000002 +#if defined(HAVE_AESGCM) || defined(HAVE_AESCCM) +/* Define AES_AUTH_ADD_SZ already here, since it's used in the + * static declaration of `bench_Usage_msg1`. */ +#if !defined(AES_AUTH_ADD_SZ) && \ + defined(STM32_CRYPTO) && !defined(STM32_AESGCM_PARTIAL) || \ + defined(WOLFSSL_XILINX_CRYPT_VERSAL) + /* For STM32 use multiple of 4 to leverage crypto hardware + * Xilinx Versal requires to use multiples of 16 bytes */ + #define AES_AUTH_ADD_SZ 16 +#endif +#ifndef AES_AUTH_ADD_SZ + #define AES_AUTH_ADD_SZ 13 +#endif +#endif /* Benchmark all compiled in algorithms. * When 1, ignore other benchmark algorithm values. @@ -888,12 +902,15 @@ static int lng_index = 0; #ifndef NO_MAIN_DRIVER #ifndef MAIN_NO_ARGS -static const char* bench_Usage_msg1[][18] = { +static const char* bench_Usage_msg1[][21] = { /* 0 English */ { "-? Help, print this usage\n 0: English, 1: Japanese\n", "-csv Print terminal output in csv format\n", "-base10 Display bytes as power of 10 (eg 1 kB = 1000 Bytes)\n", "-no_aad No additional authentication data passed.\n", + "-aad_size With bytes of AAD.\n", + "-all_aad With AAD length of 0, " WC_STRINGIFY(AES_AUTH_ADD_SZ) " and\n" + " (if set via -aad_size) bytes.\n", "-dgst_full Full digest operation performed.\n", "-rsa_sign Measure RSA sign/verify instead of encrypt/decrypt.\n", " -rsa-sz\n Measure RSA performance.\n", @@ -906,6 +923,8 @@ static const char* bench_Usage_msg1[][18] = { "- Algorithm to benchmark. Available algorithms include:\n", "-lng Display benchmark result by specified language.\n 0: English, 1: Japanese\n", " Size of block in bytes\n", + "-blocks Number of blocks. Can be used together with the 'Size of block'\n" + " option, but must be used after that one.\n" "-threads Number of threads to run\n", "-print Show benchmark stats summary\n" }, @@ -915,6 +934,8 @@ static const char* bench_Usage_msg1[][18] = { "-csv csv 形式で端末に出力します。\n", "-base10 バイトを10のべき乗で表示します。(例 1 kB = 1000 Bytes)\n", "-no_aad 追加の認証データを使用しません.\n", + "-aad_size TBD.\n", + "-all_aad TBD.\n", "-dgst_full フルの digest 暗号操作を実施します。\n", "-rsa_sign 暗号/復号化の代わりに RSA の署名/検証を測定します。\n", " -rsa-sz\n RSA の性能を測定します。\n", @@ -927,6 +948,7 @@ static const char* bench_Usage_msg1[][18] = { "- アルゴリズムのベンチマークを実施します。\n 利用可能なアルゴリズムは下記を含みます:\n", "-lng 指定された言語でベンチマーク結果を表示します。\n 0: 英語、 1: 日本語\n", " ブロックサイズをバイト単位で指定します。\n", + "-blocks TBD.\n", "-threads 実行するスレッド数\n", "-print ベンチマーク統計の要約を表示する\n" }, @@ -1033,12 +1055,13 @@ static const char* bench_desc_words[][15] = { /* determine benchmark buffer to use (if NO_FILESYSTEM) */ #if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) && \ - !defined(USE_CERT_BUFFERS_3072) + !defined(USE_CERT_BUFFERS_3072) && !defined(USE_CERT_BUFFERS_4096) #define USE_CERT_BUFFERS_2048 /* default to 2048 */ #endif #if defined(USE_CERT_BUFFERS_1024) || defined(USE_CERT_BUFFERS_2048) || \ - defined(USE_CERT_BUFFERS_3072) || !defined(NO_DH) + defined(USE_CERT_BUFFERS_3072) || defined(USE_CERT_BUFFERS_4096) || \ + !defined(NO_DH) /* include test cert and key buffers for use with NO_FILESYSTEM */ #include #endif @@ -1264,17 +1287,43 @@ static const char* bench_result_words2[][5] = { #endif #if defined(HAVE_AESGCM) || defined(HAVE_AESCCM) - #if !defined(AES_AUTH_ADD_SZ) && \ - defined(STM32_CRYPTO) && !defined(STM32_AESGCM_PARTIAL) - /* For STM32 use multiple of 4 to leverage crypto hardware */ - #define AES_AUTH_ADD_SZ 16 - #endif - #ifndef AES_AUTH_ADD_SZ - #define AES_AUTH_ADD_SZ 13 - #endif #define AES_AUTH_TAG_SZ 16 #define BENCH_CIPHER_ADD AES_AUTH_TAG_SZ static word32 aesAuthAddSz = AES_AUTH_ADD_SZ; + #if !defined(AES_AAD_OPTIONS_DEFAULT) + #if !defined(NO_MAIN_DRIVER) + #define AES_AAD_OPTIONS_DEFAULT 0x1U + #else + #define AES_AAD_OPTIONS_DEFAULT 0x3U + #endif + #endif + #define AES_AAD_STRING(s) (aesAuthAddSz == 0 ? s "-no_AAD" : (aesAuthAddSz == AES_AUTH_ADD_SZ ? s : s "-custom")) + enum en_aad_options { + AAD_SIZE_DEFAULT = 0x1U, + AAD_SIZE_ZERO = 0x2U, + AAD_SIZE_CUSTOM = 0x4U, + }; + static word32 aes_aad_options = AES_AAD_OPTIONS_DEFAULT; + static word32 aes_aad_size = 0; + static void bench_aes_aad_options_wrap(void (*fn)(int), int i) + { + word32 aesAuthAddSz_orig = aesAuthAddSz; + word32 options = aes_aad_options; + while(options) { + if (options & AAD_SIZE_DEFAULT) { + aesAuthAddSz = AES_AUTH_ADD_SZ; + options &= ~AAD_SIZE_DEFAULT; + } else if (options & AAD_SIZE_ZERO) { + aesAuthAddSz = 0; + options &= ~AAD_SIZE_ZERO; + } else if (options & AAD_SIZE_CUSTOM) { + aesAuthAddSz = aes_aad_size; + options &= ~AAD_SIZE_CUSTOM; + } + fn(i); + aesAuthAddSz = aesAuthAddSz_orig; + } + } #endif #ifndef BENCH_CIPHER_ADD #define BENCH_CIPHER_ADD 0 @@ -1289,8 +1338,9 @@ static const char* bench_result_words2[][5] = { genTimes = BENCH_MAX_PENDING, agreeTimes = 2 }; - static int numBlocks = 25; /* how many kB to test (en/de)cryption */ - static word32 bench_size = (1024ul); + /* how many kB to test (en/de)cryption */ + #define NUM_BLOCKS 25 + #define BENCH_SIZE (1024uL) #else enum BenchmarkBounds { scryptCnt = 10, @@ -1298,9 +1348,12 @@ static const char* bench_result_words2[][5] = { genTimes = BENCH_MAX_PENDING, /* must be at least BENCH_MAX_PENDING */ agreeTimes = 100 }; - static int numBlocks = 5; /* how many megs to test (en/de)cryption */ - static word32 bench_size = (1024*1024UL); + /* how many megs to test (en/de)cryption */ + #define NUM_BLOCKS 5 + #define BENCH_SIZE (1024*1024uL) #endif +static int numBlocks = NUM_BLOCKS; +static word32 bench_size = BENCH_SIZE; static int base2 = 1; static int digest_stream = 1; #ifndef NO_RSA @@ -1314,12 +1367,17 @@ static int use_ffdhe = 0; /* Don't print out in CSV format by default */ static int csv_format = 0; -#ifdef BENCH_ASYM static int csv_header_count = 0; -#endif -/* for compatibility */ -#define BENCH_SIZE bench_size +#ifdef WOLFSSL_XILINX_CRYPT_VERSAL +/* Versal PLM maybe prints an error message to the same console. + * In order to not mix those outputs up, sleep a little while + * before erroring out. + */ +#define SLEEP_ON_ERROR(ret) do{ if (ret != 0) { sleep(1); } }while(0) +#else +#define SLEEP_ON_ERROR(ret) do{ /* noop */ }while(0) +#endif /* globals for cipher tests */ static THREAD_LS_T byte* bench_plain = NULL; @@ -1359,26 +1417,32 @@ static THREAD_LS_T byte* bench_iv = NULL; /* This code handles cases with systems where static (non cost) ram variables aren't properly initialized with data */ -static int gBenchStaticInit = 0; -static void benchmark_static_init(void) +static void benchmark_static_init(int force) { - if (gBenchStaticInit == 0) { + static int gBenchStaticInit = 0; + if (gBenchStaticInit == 0 || force) { gBenchStaticInit = 1; /* Init static variables */ - bench_all = 1; - #ifdef BENCH_EMBEDDED - numBlocks = 25; /* how many kB to test (en/de)cryption */ - bench_size = (1024ul); - #else - numBlocks = 5; /* how many megs to test (en/de)cryption */ - bench_size = (1024*1024UL); - #endif + numBlocks = NUM_BLOCKS; + bench_size = BENCH_SIZE; #if defined(HAVE_AESGCM) || defined(HAVE_AESCCM) - aesAuthAddSz = AES_AUTH_ADD_SZ; + aesAuthAddSz = AES_AUTH_ADD_SZ; + aes_aad_options = AES_AAD_OPTIONS_DEFAULT; + aes_aad_size = 0; #endif base2 = 1; digest_stream = 1; + + bench_all = 1; + bench_cipher_algs = 0; + bench_digest_algs = 0; + bench_mac_algs = 0; + bench_asym_algs = 0; + bench_pq_asym_algs = 0; + bench_other_algs = 0; + csv_format = 0; + csv_header_count = 0; } } @@ -1595,30 +1659,38 @@ static void bench_stats_sym_finish(const char* desc, int useDeviceID, int count, /* calculate actual bytes */ blocks *= countSz; + if (csv_format == 1) { + /* only print out header once */ + if (csv_header_count == 1) { + printf("\n\nSymmetric Ciphers:\n\n"); + printf("Algorithm,MB/s,Cycles per byte,\n"); + csv_header_count++; + } + } if (base2) { - /* determine if we should show as KB or MB */ + /* determine if we should show as KiB or MiB */ if (blocks > (1024UL * 1024UL)) { blocks /= (1024UL * 1024UL); - blockType = "MB"; + blockType = "MiB"; } else if (blocks > 1024) { - blocks /= 1024; /* make KB */ - blockType = "KB"; + blocks /= 1024; + blockType = "KiB"; } else { blockType = "bytes"; } } else { - /* determine if we should show as kB or mB */ + /* determine if we should show as KB or MB */ if (blocks > (1000UL * 1000UL)) { blocks /= (1000UL * 1000UL); - blockType = "mB"; + blockType = "MB"; } else if (blocks > 1000) { - blocks /= 1000; /* make kB */ - blockType = "kB"; + blocks /= 1000; /* make KB */ + blockType = "KB"; } else { blockType = "bytes"; @@ -1630,12 +1702,17 @@ static void bench_stats_sym_finish(const char* desc, int useDeviceID, int count, persec = (1 / total) * blocks; } + SLEEP_ON_ERROR(ret); /* format and print to terminal */ if (csv_format == 1) { - (void)XSNPRINTF(msg, sizeof(msg), "%s,%.3f,", desc, persec); + if (blockType[0] == 'K') + persec /= base2 ? 1024. : 1000.; + else if (blockType[0] == 'b') + persec /= base2 ? (1024. * 1024.) : (1000. * 1000.); + (void)XSNPRINTF(msg, sizeof(msg), "%s,%f,", desc, persec); SHOW_INTEL_CYCLES_CSV(msg, sizeof(msg), countSz); } else { - (void)XSNPRINTF(msg, sizeof(msg), "%-16s%s %5.0f %s %s %5.3f %s, %8.3f %s/s", + (void)XSNPRINTF(msg, sizeof(msg), "%-24s%s %5.0f %s %s %5.3f %s, %8.3f %s/s", desc, BENCH_ASYNC_GET_NAME(useDeviceID), blocks, blockType, word[0], total, word[1], persec, blockType); SHOW_INTEL_CYCLES(msg, sizeof(msg), countSz); @@ -1676,15 +1753,16 @@ static void bench_stats_asym_finish(const char* algo, int strength, opsSec = count / total; /* ops second */ milliEach = each * 1000; /* milliseconds */ + SLEEP_ON_ERROR(ret); /* format and print to terminal */ if (csv_format == 1) { /* only print out header once */ if (csv_header_count == 1) { printf("\nAsymmetric Ciphers:\n\n"); - printf("Algorithm,avg ms,ops/sec,\n"); + printf("Algorithm,key size,operation,avg ms,ops/sec,\n"); csv_header_count++; } - (void)XSNPRINTF(msg, sizeof(msg), "%s %d %s,%.3f,%.3f,\n", algo, strength, desc, milliEach, opsSec); + (void)XSNPRINTF(msg, sizeof(msg), "%s,%d,%s,%.3f,%.3f,\n", algo, strength, desc, milliEach, opsSec); } else { (void)XSNPRINTF(msg, sizeof(msg), "%-6s %5d %-9s %s %6d %s %5.3f %s, %s %5.3f ms," " %.3f %s\n", algo, strength, desc, BENCH_ASYNC_GET_NAME(useDeviceID), @@ -1897,13 +1975,13 @@ static void* benchmarks_do(void* args) #ifdef HAVE_AESGCM if (bench_all || (bench_cipher_algs & BENCH_AES_GCM)) { #ifndef NO_SW_BENCH - bench_aesgcm(0); + bench_aes_aad_options_wrap(bench_aesgcm, 0); #endif #if ((defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_3DES)) || \ defined(HAVE_INTEL_QA_SYNC) || defined(HAVE_CAVIUM_OCTEON_SYNC) || \ defined(HAVE_RENESAS_SYNC) || defined(WOLFSSL_CAAM)) && \ !defined(NO_HW_BENCH) - bench_aesgcm(1); + bench_aes_aad_options_wrap(bench_aesgcm, 1); #endif bench_gmac(); @@ -1938,7 +2016,7 @@ static void* benchmarks_do(void* args) #endif #ifdef HAVE_AESCCM if (bench_all || (bench_cipher_algs & BENCH_AES_CCM)) - bench_aesccm(); + bench_aes_aad_options_wrap(bench_aesccm, 0); #endif #ifdef WOLFSSL_AES_SIV if (bench_all || (bench_cipher_algs & BENCH_AES_SIV)) @@ -2542,7 +2620,7 @@ int benchmark_init(void) { int ret = 0; - benchmark_static_init(); + benchmark_static_init(0); #ifdef WOLFSSL_STATIC_MEMORY ret = wc_LoadStaticMemory(&HEAP_HINT, gBenchMemory, sizeof(gBenchMemory), @@ -2576,15 +2654,10 @@ int benchmark_init(void) wolfSSL_Debugging_ON(); #endif + printf("wolfCrypt Benchmark (block bytes %d, min %.1f sec each)\n", + (int)bench_size, BENCH_MIN_RUNTIME_SEC); if (csv_format == 1) { - printf("wolfCrypt Benchmark (block bytes %d, min %.1f sec each)\n", - (int)BENCH_SIZE, BENCH_MIN_RUNTIME_SEC); printf("This format allows you to easily copy the output to a csv file."); - printf("\n\nSymmetric Ciphers:\n\n"); - printf("Algorithm,MB/s,Cycles per byte,\n"); - } else { - printf("wolfCrypt Benchmark (block bytes %d, min %.1f sec each)\n", - (int)BENCH_SIZE, BENCH_MIN_RUNTIME_SEC); } #ifdef HAVE_WNR @@ -2752,7 +2825,7 @@ int benchmark_test(void *args) #else benchmarks_do(NULL); #endif - + SLEEP_ON_ERROR(1); printf("Benchmark complete\n"); ret = benchmark_free(); @@ -2784,7 +2857,7 @@ void bench_rng(void) for (i = 0; i < numBlocks; i++) { /* Split request to handle large RNG request */ pos = 0; - remain = (int)BENCH_SIZE; + remain = (int)bench_size; while (remain > 0) { len = remain; if (len > RNG_MAX_BLOCK_LEN) @@ -2846,7 +2919,7 @@ static void bench_aescbc_internal(int useDeviceID, const byte* key, word32 keySz if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&enc[i]), 0, ×, numBlocks, &pending)) { ret = wc_AesCbcEncrypt(&enc[i], bench_plain, bench_cipher, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&enc[i]), 0, ×, &pending)) { @@ -2884,7 +2957,7 @@ exit_aes_enc: if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&enc[i]), 0, ×, numBlocks, &pending)) { ret = wc_AesCbcDecrypt(&enc[i], bench_cipher, bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&enc[i]), 0, ×, &pending)) { @@ -2988,14 +3061,14 @@ static void bench_aesgcm_internal(int useDeviceID, const byte* key, word32 keySz ×, numBlocks, &pending)) { #ifndef BENCHMARK_AESGCM_STREAM ret = wc_AesGcmEncrypt(&enc[i], bench_cipher, - bench_plain, BENCH_SIZE, + bench_plain, bench_size, iv, ivSz, bench_tag, AES_AUTH_TAG_SZ, bench_additional, aesAuthAddSz); #else ret = wc_AesGcmEncryptInit(&enc[i], NULL, 0, iv, ivSz); if (ret == 0) { ret = wc_AesGcmEncryptUpdate(&enc[i], bench_cipher, - bench_plain, BENCH_SIZE, bench_additional, + bench_plain, bench_size, bench_additional, aesAuthAddSz); } if (ret == 0) { @@ -3042,14 +3115,14 @@ exit_aes_gcm: ×, numBlocks, &pending)) { #ifndef BENCHMARK_AESGCM_STREAM ret = wc_AesGcmDecrypt(&dec[i], bench_plain, - bench_cipher, BENCH_SIZE, + bench_cipher, bench_size, iv, ivSz, bench_tag, AES_AUTH_TAG_SZ, bench_additional, aesAuthAddSz); #else ret = wc_AesGcmDecryptInit(&enc[i], NULL, 0, iv, ivSz); if (ret == 0) { ret = wc_AesGcmDecryptUpdate(&enc[i], bench_plain, - bench_cipher, BENCH_SIZE, bench_additional, + bench_cipher, bench_size, bench_additional, aesAuthAddSz); } if (ret == 0) { @@ -3092,20 +3165,22 @@ exit: void bench_aesgcm(int useDeviceID) { +#define AES_GCM_STRING(n, dir) AES_AAD_STRING("AES-" #n "-GCM-" #dir) #if defined(WOLFSSL_AES_128) && !defined(WOLFSSL_AFALG_XILINX_AES) \ - && !defined(WOLFSSL_XILINX_CRYPT) + && !defined(WOLFSSL_XILINX_CRYPT) || defined(WOLFSSL_XILINX_CRYPT_VERSAL) bench_aesgcm_internal(useDeviceID, bench_key, 16, bench_iv, 12, - "AES-128-GCM-enc", "AES-128-GCM-dec"); + AES_GCM_STRING(128, enc), AES_GCM_STRING(128, dec)); #endif #if defined(WOLFSSL_AES_192) && !defined(WOLFSSL_AFALG_XILINX_AES) \ && !defined(WOLFSSL_XILINX_CRYPT) bench_aesgcm_internal(useDeviceID, bench_key, 24, bench_iv, 12, - "AES-192-GCM-enc", "AES-192-GCM-dec"); + AES_GCM_STRING(192, enc), AES_GCM_STRING(192, dec)); #endif #ifdef WOLFSSL_AES_256 bench_aesgcm_internal(useDeviceID, bench_key, 32, bench_iv, 12, - "AES-256-GCM-enc", "AES-256-GCM-dec"); + AES_GCM_STRING(256, enc), AES_GCM_STRING(256, dec)); #endif +#undef AES_GCM_STRING } /* GMAC */ @@ -3289,7 +3364,7 @@ static void bench_aescfb_internal(const byte* key, word32 keySz, const byte* iv, do { for (i = 0; i < numBlocks; i++) { if((ret = wc_AesCfbEncrypt(&enc, bench_plain, bench_cipher, - BENCH_SIZE)) != 0) { + bench_size)) != 0) { printf("wc_AesCfbEncrypt failed, ret = %d\n", ret); return; } @@ -3332,7 +3407,7 @@ static void bench_aesofb_internal(const byte* key, word32 keySz, const byte* iv, do { for (i = 0; i < numBlocks; i++) { if((ret = wc_AesOfbEncrypt(&enc, bench_plain, bench_cipher, - BENCH_SIZE)) != 0) { + bench_size)) != 0) { printf("wc_AesCfbEncrypt failed, ret = %d\n", ret); return; } @@ -3387,7 +3462,7 @@ void bench_aesxts(void) do { for (i = 0; i < numBlocks; i++) { if ((ret = wc_AesXtsEncrypt(&aes, bench_cipher, bench_plain, - BENCH_SIZE, i1, sizeof(i1))) != 0) { + bench_size, i1, sizeof(i1))) != 0) { printf("wc_AesXtsEncrypt failed, ret = %d\n", ret); return; } @@ -3409,7 +3484,7 @@ void bench_aesxts(void) do { for (i = 0; i < numBlocks; i++) { if ((ret = wc_AesXtsDecrypt(&aes, bench_plain, bench_cipher, - BENCH_SIZE, i1, sizeof(i1))) != 0) { + bench_size, i1, sizeof(i1))) != 0) { printf("wc_AesXtsDecrypt failed, ret = %d\n", ret); return; } @@ -3436,7 +3511,7 @@ static void bench_aesctr_internal(const byte* key, word32 keySz, const byte* iv, do { for (i = 0; i < numBlocks; i++) { if((ret = wc_AesCtrEncrypt(&enc, bench_plain, bench_cipher, - BENCH_SIZE)) != 0) { + bench_size)) != 0) { printf("wc_AesCtrEncrypt failed, ret = %d\n", ret); return; } @@ -3462,7 +3537,7 @@ void bench_aesctr(void) #ifdef HAVE_AESCCM -void bench_aesccm(void) +void bench_aesccm(int dummy) { Aes enc; double start; @@ -3478,6 +3553,8 @@ void bench_aesccm(void) } #endif + (void) dummy; + XMEMSET(bench_tag, 0, AES_AUTH_TAG_SZ); XMEMSET(bench_additional, 0, AES_AUTH_ADD_SZ); @@ -3494,13 +3571,13 @@ void bench_aesccm(void) bench_stats_start(&count, &start); do { for (i = 0; i < numBlocks; i++) { - ret |= wc_AesCcmEncrypt(&enc, bench_cipher, bench_plain, BENCH_SIZE, + ret |= wc_AesCcmEncrypt(&enc, bench_cipher, bench_plain, bench_size, bench_iv, 12, bench_tag, AES_AUTH_TAG_SZ, bench_additional, aesAuthAddSz); } count += i; } while (bench_stats_sym_check(start)); - bench_stats_sym_finish("AES-CCM-Enc", 0, count, bench_size, start, ret); + bench_stats_sym_finish(AES_AAD_STRING("AES-CCM-enc"), 0, count, bench_size, start, ret); if (ret != 0) { printf("wc_AesCcmEncrypt failed, ret = %d\n", ret); goto exit; @@ -3509,13 +3586,13 @@ void bench_aesccm(void) bench_stats_start(&count, &start); do { for (i = 0; i < numBlocks; i++) { - ret |= wc_AesCcmDecrypt(&enc, bench_plain, bench_cipher, BENCH_SIZE, + ret |= wc_AesCcmDecrypt(&enc, bench_plain, bench_cipher, bench_size, bench_iv, 12, bench_tag, AES_AUTH_TAG_SZ, bench_additional, aesAuthAddSz); } count += i; } while (bench_stats_sym_check(start)); - bench_stats_sym_finish("AES-CCM-Dec", 0, count, bench_size, start, ret); + bench_stats_sym_finish(AES_AAD_STRING("AES-CCM-dec"), 0, count, bench_size, start, ret); if (ret != 0) { printf("wc_AesCcmEncrypt failed, ret = %d\n", ret); goto exit; @@ -3600,7 +3677,7 @@ void bench_poly1305(void) bench_stats_start(&count, &start); do { for (i = 0; i < numBlocks; i++) { - ret = wc_Poly1305Update(&enc, bench_plain, BENCH_SIZE); + ret = wc_Poly1305Update(&enc, bench_plain, bench_size); if (ret != 0) { printf("Poly1305Update failed: %d\n", ret); break; @@ -3620,7 +3697,7 @@ void bench_poly1305(void) printf("Poly1305SetKey failed, ret = %d\n", ret); return; } - ret = wc_Poly1305Update(&enc, bench_plain, BENCH_SIZE); + ret = wc_Poly1305Update(&enc, bench_plain, bench_size); if (ret != 0) { printf("Poly1305Update failed: %d\n", ret); break; @@ -3652,7 +3729,7 @@ void bench_camellia(void) do { for (i = 0; i < numBlocks; i++) { ret = wc_CamelliaCbcEncrypt(&cam, bench_cipher, bench_plain, - BENCH_SIZE); + bench_size); if (ret < 0) { printf("CamelliaCbcEncrypt failed: %d\n", ret); return; @@ -3700,7 +3777,7 @@ void bench_des(int useDeviceID) if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&enc[i]), 0, ×, numBlocks, &pending)) { ret = wc_Des3_CbcEncrypt(&enc[i], bench_cipher, bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&enc[i]), 0, ×, &pending)) { goto exit_3des; @@ -3757,7 +3834,7 @@ void bench_arc4(int useDeviceID) if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&enc[i]), 0, ×, numBlocks, &pending)) { ret = wc_Arc4Process(&enc[i], bench_cipher, bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&enc[i]), 0, ×, &pending)) { goto exit_arc4; @@ -3792,7 +3869,7 @@ void bench_chacha(void) do { for (i = 0; i < numBlocks; i++) { wc_Chacha_SetIV(&enc, bench_iv, 0); - wc_Chacha_Process(&enc, bench_cipher, bench_plain, BENCH_SIZE); + wc_Chacha_Process(&enc, bench_cipher, bench_plain, bench_size); } count += i; } while (bench_stats_sym_check(start)); @@ -3813,7 +3890,7 @@ void bench_chacha20_poly1305_aead(void) do { for (i = 0; i < numBlocks; i++) { ret = wc_ChaCha20Poly1305_Encrypt(bench_key, bench_iv, NULL, 0, - bench_plain, BENCH_SIZE, bench_cipher, authTag); + bench_plain, bench_size, bench_cipher, authTag); if (ret < 0) { printf("wc_ChaCha20Poly1305_Encrypt error: %d\n", ret); break; @@ -3848,7 +3925,7 @@ void bench_md5(int useDeviceID) goto exit; } #ifdef WOLFSSL_PIC32MZ_HASH - wc_Md5SizeSet(&hash[i], numBlocks * BENCH_SIZE); + wc_Md5SizeSet(&hash[i], numBlocks * bench_size); #endif } @@ -3862,7 +3939,7 @@ void bench_md5(int useDeviceID) if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, numBlocks, &pending)) { ret = wc_Md5Update(&hash[i], bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, &pending)) { goto exit_md5; @@ -3895,7 +3972,7 @@ void bench_md5(int useDeviceID) for (times = 0; times < numBlocks; times++) { ret = wc_InitMd5_ex(hash, HEAP_HINT, INVALID_DEVID); if (ret == 0) - ret = wc_Md5Update(hash, bench_plain, BENCH_SIZE); + ret = wc_Md5Update(hash, bench_plain, bench_size); if (ret == 0) ret = wc_Md5Final(hash, digest[0]); if (ret != 0) @@ -3942,7 +4019,7 @@ void bench_sha(int useDeviceID) goto exit; } #ifdef WOLFSSL_PIC32MZ_HASH - wc_ShaSizeSet(&hash[i], numBlocks * BENCH_SIZE); + wc_ShaSizeSet(&hash[i], numBlocks * bench_size); #endif } @@ -3956,7 +4033,7 @@ void bench_sha(int useDeviceID) if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, numBlocks, &pending)) { ret = wc_ShaUpdate(&hash[i], bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, &pending)) { goto exit_sha; @@ -3989,7 +4066,7 @@ void bench_sha(int useDeviceID) for (times = 0; times < numBlocks; times++) { ret = wc_InitSha_ex(hash, HEAP_HINT, INVALID_DEVID); if (ret == 0) - ret = wc_ShaUpdate(hash, bench_plain, BENCH_SIZE); + ret = wc_ShaUpdate(hash, bench_plain, bench_size); if (ret == 0) ret = wc_ShaFinal(hash, digest[0]); if (ret != 0) @@ -4045,7 +4122,7 @@ void bench_sha224(int useDeviceID) if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, numBlocks, &pending)) { ret = wc_Sha224Update(&hash[i], bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, &pending)) { goto exit_sha224; @@ -4077,7 +4154,7 @@ void bench_sha224(int useDeviceID) for (times = 0; times < numBlocks; times++) { ret = wc_InitSha224_ex(hash, HEAP_HINT, INVALID_DEVID); if (ret == 0) - ret = wc_Sha224Update(hash, bench_plain, BENCH_SIZE); + ret = wc_Sha224Update(hash, bench_plain, bench_size); if (ret == 0) ret = wc_Sha224Final(hash, digest[0]); if (ret != 0) @@ -4121,7 +4198,7 @@ void bench_sha256(int useDeviceID) goto exit; } #ifdef WOLFSSL_PIC32MZ_HASH - wc_Sha256SizeSet(&hash[i], numBlocks * BENCH_SIZE); + wc_Sha256SizeSet(&hash[i], numBlocks * bench_size); #endif } @@ -4135,7 +4212,7 @@ void bench_sha256(int useDeviceID) if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, numBlocks, &pending)) { ret = wc_Sha256Update(&hash[i], bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, &pending)) { goto exit_sha256; @@ -4167,7 +4244,7 @@ void bench_sha256(int useDeviceID) for (times = 0; times < numBlocks; times++) { ret = wc_InitSha256_ex(hash, HEAP_HINT, INVALID_DEVID); if (ret == 0) - ret = wc_Sha256Update(hash, bench_plain, BENCH_SIZE); + ret = wc_Sha256Update(hash, bench_plain, bench_size); if (ret == 0) ret = wc_Sha256Final(hash, digest[0]); if (ret != 0) @@ -4222,7 +4299,7 @@ void bench_sha384(int useDeviceID) if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, numBlocks, &pending)) { ret = wc_Sha384Update(&hash[i], bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, &pending)) { goto exit_sha384; @@ -4254,7 +4331,7 @@ void bench_sha384(int useDeviceID) for (times = 0; times < numBlocks; times++) { ret = wc_InitSha384_ex(hash, HEAP_HINT, INVALID_DEVID); if (ret == 0) - ret = wc_Sha384Update(hash, bench_plain, BENCH_SIZE); + ret = wc_Sha384Update(hash, bench_plain, bench_size); if (ret == 0) ret = wc_Sha384Final(hash, digest[0]); if (ret != 0) @@ -4309,7 +4386,7 @@ void bench_sha512(int useDeviceID) if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, numBlocks, &pending)) { ret = wc_Sha512Update(&hash[i], bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, &pending)) { goto exit_sha512; @@ -4341,7 +4418,7 @@ void bench_sha512(int useDeviceID) for (times = 0; times < numBlocks; times++) { ret = wc_InitSha512_ex(hash, HEAP_HINT, INVALID_DEVID); if (ret == 0) - ret = wc_Sha512Update(hash, bench_plain, BENCH_SIZE); + ret = wc_Sha512Update(hash, bench_plain, bench_size); if (ret == 0) ret = wc_Sha512Final(hash, digest[0]); if (ret != 0) @@ -4398,7 +4475,7 @@ void bench_sha3_224(int useDeviceID) if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, numBlocks, &pending)) { ret = wc_Sha3_224_Update(&hash[i], bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, &pending)) { goto exit_sha3_224; @@ -4430,7 +4507,7 @@ void bench_sha3_224(int useDeviceID) for (times = 0; times < numBlocks; times++) { ret = wc_InitSha3_224(hash, HEAP_HINT, INVALID_DEVID); if (ret == 0) - ret = wc_Sha3_224_Update(hash, bench_plain, BENCH_SIZE); + ret = wc_Sha3_224_Update(hash, bench_plain, bench_size); if (ret == 0) ret = wc_Sha3_224_Final(hash, digest[0]); if (ret != 0) @@ -4485,7 +4562,7 @@ void bench_sha3_256(int useDeviceID) if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, numBlocks, &pending)) { ret = wc_Sha3_256_Update(&hash[i], bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, &pending)) { goto exit_sha3_256; @@ -4517,7 +4594,7 @@ void bench_sha3_256(int useDeviceID) for (times = 0; times < numBlocks; times++) { ret = wc_InitSha3_256(hash, HEAP_HINT, INVALID_DEVID); if (ret == 0) - ret = wc_Sha3_256_Update(hash, bench_plain, BENCH_SIZE); + ret = wc_Sha3_256_Update(hash, bench_plain, bench_size); if (ret == 0) ret = wc_Sha3_256_Final(hash, digest[0]); if (ret != 0) @@ -4572,7 +4649,7 @@ void bench_sha3_384(int useDeviceID) if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, numBlocks, &pending)) { ret = wc_Sha3_384_Update(&hash[i], bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, &pending)) { goto exit_sha3_384; @@ -4604,7 +4681,7 @@ void bench_sha3_384(int useDeviceID) for (times = 0; times < numBlocks; times++) { ret = wc_InitSha3_384(hash, HEAP_HINT, INVALID_DEVID); if (ret == 0) - ret = wc_Sha3_384_Update(hash, bench_plain, BENCH_SIZE); + ret = wc_Sha3_384_Update(hash, bench_plain, bench_size); if (ret == 0) ret = wc_Sha3_384_Final(hash, digest[0]); if (ret != 0) @@ -4659,7 +4736,7 @@ void bench_sha3_512(int useDeviceID) if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, numBlocks, &pending)) { ret = wc_Sha3_512_Update(&hash[i], bench_plain, - BENCH_SIZE); + bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&hash[i]), 0, ×, &pending)) { goto exit_sha3_512; @@ -4691,7 +4768,7 @@ void bench_sha3_512(int useDeviceID) for (times = 0; times < numBlocks; times++) { ret = wc_InitSha3_512(hash, HEAP_HINT, INVALID_DEVID); if (ret == 0) - ret = wc_Sha3_512_Update(hash, bench_plain, BENCH_SIZE); + ret = wc_Sha3_512_Update(hash, bench_plain, bench_size); if (ret == 0) ret = wc_Sha3_512_Final(hash, digest[0]); if (ret != 0) @@ -4910,7 +4987,7 @@ int bench_ripemd(void) bench_stats_start(&count, &start); do { for (i = 0; i < numBlocks; i++) { - ret = wc_RipeMdUpdate(&hash, bench_plain, BENCH_SIZE); + ret = wc_RipeMdUpdate(&hash, bench_plain, bench_size); if (ret != 0) { return ret; } @@ -4931,7 +5008,7 @@ int bench_ripemd(void) if (ret != 0) { return ret; } - ret = wc_RipeMdUpdate(&hash, bench_plain, BENCH_SIZE); + ret = wc_RipeMdUpdate(&hash, bench_plain, bench_size); if (ret != 0) { return ret; } @@ -4968,7 +5045,7 @@ void bench_blake2b(void) bench_stats_start(&count, &start); do { for (i = 0; i < numBlocks; i++) { - ret = wc_Blake2bUpdate(&b2b, bench_plain, BENCH_SIZE); + ret = wc_Blake2bUpdate(&b2b, bench_plain, bench_size); if (ret != 0) { printf("Blake2bUpdate failed, ret = %d\n", ret); return; @@ -4991,7 +5068,7 @@ void bench_blake2b(void) printf("InitBlake2b failed, ret = %d\n", ret); return; } - ret = wc_Blake2bUpdate(&b2b, bench_plain, BENCH_SIZE); + ret = wc_Blake2bUpdate(&b2b, bench_plain, bench_size); if (ret != 0) { printf("Blake2bUpdate failed, ret = %d\n", ret); return; @@ -5027,7 +5104,7 @@ void bench_blake2s(void) bench_stats_start(&count, &start); do { for (i = 0; i < numBlocks; i++) { - ret = wc_Blake2sUpdate(&b2s, bench_plain, BENCH_SIZE); + ret = wc_Blake2sUpdate(&b2s, bench_plain, bench_size); if (ret != 0) { printf("Blake2sUpdate failed, ret = %d\n", ret); return; @@ -5050,7 +5127,7 @@ void bench_blake2s(void) printf("InitBlake2b failed, ret = %d\n", ret); return; } - ret = wc_Blake2sUpdate(&b2s, bench_plain, BENCH_SIZE); + ret = wc_Blake2sUpdate(&b2s, bench_plain, bench_size); if (ret != 0) { printf("Blake2bUpdate failed, ret = %d\n", ret); return; @@ -5113,7 +5190,7 @@ static void bench_cmac_helper(int keySz, const char* outMsg) #endif for (i = 0; i < numBlocks; i++) { - ret = wc_CmacUpdate(&cmac, bench_plain, BENCH_SIZE); + ret = wc_CmacUpdate(&cmac, bench_plain, bench_size); if (ret != 0) { printf("CmacUpdate failed, ret = %d\n", ret); return; @@ -5213,7 +5290,7 @@ static void bench_hmac(int useDeviceID, int type, int digestSz, for (i = 0; i < BENCH_MAX_PENDING; i++) { if (bench_async_check(&ret, BENCH_ASYNC_GET_DEV(&hmac[i]), 0, ×, numBlocks, &pending)) { - ret = wc_HmacUpdate(&hmac[i], bench_plain, BENCH_SIZE); + ret = wc_HmacUpdate(&hmac[i], bench_plain, bench_size); if (!bench_async_handle(&ret, BENCH_ASYNC_GET_DEV(&hmac[i]), 0, ×, &pending)) { goto exit_hmac; @@ -5382,22 +5459,22 @@ void bench_siphash(void) bench_stats_start(&count, &start); do { for (i = 0; i < numBlocks; i++) { - ret = wc_SipHash((const byte*)passwd16, bench_plain, BENCH_SIZE, + ret = wc_SipHash((const byte*)passwd16, bench_plain, bench_size, out, 8); } count += i; } while (bench_stats_sym_check(start)); - bench_stats_sym_finish("SipHash-8", 1, count, BENCH_SIZE, start, ret); + bench_stats_sym_finish("SipHash-8", 1, count, bench_size, start, ret); bench_stats_start(&count, &start); do { for (i = 0; i < numBlocks; i++) { - ret = wc_SipHash((const byte*)passwd16, bench_plain, BENCH_SIZE, + ret = wc_SipHash((const byte*)passwd16, bench_plain, bench_size, out, 16); } count += i; } while (bench_stats_sym_check(start)); - bench_stats_sym_finish("SipHash-16", 1, count, BENCH_SIZE, start, ret); + bench_stats_sym_finish("SipHash-16", 1, count, bench_size, start, ret); } #endif @@ -5473,7 +5550,7 @@ void bench_rsaKeyGen_size(int useDeviceID, int keySz) #endif /* WOLFSSL_KEY_GEN */ #if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) && \ - !defined(USE_CERT_BUFFERS_3072) + !defined(USE_CERT_BUFFERS_3072) && !defined(USE_CERT_BUFFERS_4096) #if defined(WOLFSSL_MDK_SHELL) static char *certRSAname = "certs/rsa2048.der"; /* set by shell command */ @@ -5801,6 +5878,10 @@ void bench_rsa(int useDeviceID) tmp = rsa_key_der_3072; bytes = (size_t)sizeof_rsa_key_der_3072; rsaKeySz = 3072; +#elif defined(USE_CERT_BUFFERS_4096) + tmp = client_key_der_4096; + bytes = (size_t)sizeof_client_key_der_4096; + rsaKeySz = 4096; #else #error "need a cert buffer size" #endif /* USE_CERT_BUFFERS */ @@ -5931,7 +6012,7 @@ exit_bench_rsa_key: #ifndef NO_DH #if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) && \ - !defined(USE_CERT_BUFFERS_3072) + !defined(USE_CERT_BUFFERS_3072) && !defined(USE_CERT_BUFFERS_4096) #if defined(WOLFSSL_MDK_SHELL) static char *certDHname = "certs/dh2048.der"; /* set by shell command */ @@ -6013,6 +6094,10 @@ void bench_dh(int useDeviceID) tmp = dh_key_der_3072; bytes = (size_t)sizeof_dh_key_der_3072; dhKeySz = 3072; +#elif defined(USE_CERT_BUFFERS_4096) + tmp = dh_key_der_4096; + bytes = (size_t)sizeof_dh_key_der_4096; + dhKeySz = 4096; #else #error "need to define a cert buffer size" #endif /* USE_CERT_BUFFERS */ @@ -6616,7 +6701,7 @@ void bench_eccEncrypt(int curveId) byte msg[48]; byte out[sizeof(msg) + WC_SHA256_DIGEST_SIZE + (MAX_ECC_BITS+3)/4 + 2]; word32 outSz = sizeof(out); - word32 bench_plainSz = BENCH_SIZE; + word32 bench_plainSz = bench_size; int ret, i, count; double start; const char**desc = bench_desc_words[lng_index]; @@ -8191,10 +8276,9 @@ void bench_sphincsKeySign(byte level, byte optim) } #elif defined(WOLFSSL_XILINX) - #ifndef XPAR_CPU_CORTEXA53_0_TIMESTAMP_CLK_FREQ - #define XPAR_CPU_CORTEXA53_0_TIMESTAMP_CLK_FREQ 50000000 - #endif - #ifndef COUNTS_PER_SECOND + #ifdef XPAR_VERSAL_CIPS_0_PSPMC_0_PSV_CORTEXA72_0_TIMESTAMP_CLK_FREQ + #define COUNTS_PER_SECOND XPAR_VERSAL_CIPS_0_PSPMC_0_PSV_CORTEXA72_0_TIMESTAMP_CLK_FREQ + #else #define COUNTS_PER_SECOND XPAR_CPU_CORTEXA53_0_TIMESTAMP_CLK_FREQ #endif @@ -8282,44 +8366,57 @@ static void print_alg(const char* str, int* line) static void Usage(void) { #ifndef WOLFSSL_BENCHMARK_ALL - int i; + int i, e = 0; int line; #endif printf("benchmark\n"); - printf("%s", bench_Usage_msg1[lng_index][0]); /* option -? */ - printf("%s", bench_Usage_msg1[lng_index][1]); /* option -csv */ - printf("%s", bench_Usage_msg1[lng_index][2]); /* option -base10 */ + printf("%s", bench_Usage_msg1[lng_index][e++]); /* option -? */ + printf("%s", bench_Usage_msg1[lng_index][e++]); /* option -csv */ + printf("%s", bench_Usage_msg1[lng_index][e++]); /* option -base10 */ #if defined(HAVE_AESGCM) || defined(HAVE_AESCCM) - printf("%s", bench_Usage_msg1[lng_index][3]); /* option -no_add */ + printf("%s", bench_Usage_msg1[lng_index][e++]); /* option -no_aad */ + printf("%s", bench_Usage_msg1[lng_index][e++]); /* option -aad_size */ + printf("%s", bench_Usage_msg1[lng_index][e++]); /* option -all_aad */ +#else + e += 3; #endif - printf("%s", bench_Usage_msg1[lng_index][4]); /* option -dgst_full */ + printf("%s", bench_Usage_msg1[lng_index][e++]); /* option -dgst_full */ #ifndef NO_RSA - printf("%s", bench_Usage_msg1[lng_index][5]); /* option -ras_sign */ + printf("%s", bench_Usage_msg1[lng_index][e++]); /* option -ras_sign */ #ifdef WOLFSSL_KEY_GEN - printf("%s", bench_Usage_msg1[lng_index][6]); /* option -rsa-sz */ + printf("%s", bench_Usage_msg1[lng_index][e]); /* option -rsa-sz */ #endif + e++; +#else + e += 2; #endif #if !defined(NO_DH) && defined(HAVE_FFDHE_2048) - printf("%s", bench_Usage_msg1[lng_index][7]); /* option -ffdhe2048 */ + printf("%s", bench_Usage_msg1[lng_index][e]); /* option -ffdhe2048 */ #endif + e++; #if !defined(NO_DH) && defined(HAVE_FFDHE_3072) - printf("%s", bench_Usage_msg1[lng_index][8]); /* option -ffdhe3072 */ + printf("%s", bench_Usage_msg1[lng_index][e]); /* option -ffdhe3072 */ #endif + e++; #if defined(HAVE_ECC) && !defined(NO_ECC256) - printf("%s", bench_Usage_msg1[lng_index][9]); /* option -p256 */ + printf("%s", bench_Usage_msg1[lng_index][e]); /* option -p256 */ #endif + e++; #if defined(HAVE_ECC) && defined(HAVE_ECC384) - printf("%s", bench_Usage_msg1[lng_index][10]); /* option -p384 */ + printf("%s", bench_Usage_msg1[lng_index][e]); /* option -p384 */ #endif + e++; #if defined(HAVE_ECC) && defined(HAVE_ECC521) - printf("%s", bench_Usage_msg1[lng_index][11]); /* option -p521 */ + printf("%s", bench_Usage_msg1[lng_index][e]); /* option -p521 */ #endif + e++; #if defined(HAVE_ECC) - printf("%s", bench_Usage_msg1[lng_index][12]); /* option -ecc-all */ + printf("%s", bench_Usage_msg1[lng_index][e]); /* option -ecc-all */ #endif + e++; #ifndef WOLFSSL_BENCHMARK_ALL - printf("%s", bench_Usage_msg1[lng_index][13]); /* option - */ + printf("%s", bench_Usage_msg1[lng_index][e]); /* option - */ printf(" "); line = 13; for (i=0; bench_cipher_opt[i].str != NULL; i++) @@ -8352,12 +8449,15 @@ static void Usage(void) #endif /* HAVE_LIBOQS */ #endif /* HAVE_PQC */ #endif /* !WOLFSSL_BENCHMARK_ALL */ - printf("%s", bench_Usage_msg1[lng_index][14]); /* option -lng */ - printf("%s", bench_Usage_msg1[lng_index][15]); /* option */ + e++; + printf("%s", bench_Usage_msg1[lng_index][e++]); /* option -lng */ + printf("%s", bench_Usage_msg1[lng_index][e++]); /* option */ + printf("%s", bench_Usage_msg1[lng_index][e++]); /* option -blocks */ #ifdef WC_ENABLE_BENCH_THREADING - printf("%s", bench_Usage_msg1[lng_index][16]); /* option -threads */ + printf("%s", bench_Usage_msg1[lng_index][e]); /* option -threads */ #endif - printf("%s", bench_Usage_msg1[lng_index][17]); /* option -print */ + e++; + printf("%s", bench_Usage_msg1[lng_index][e]); /* option -print */ } /* Match the command line argument with the string. @@ -8373,6 +8473,7 @@ static int string_matches(const char* arg, const char* str) } #endif /* MAIN_NO_ARGS */ +#ifndef NO_MAIN_FUNCTION #if defined(WOLFSSL_ESPIDF) || defined(_WIN32_WCE) int wolf_benchmark_task(void) #elif defined(MAIN_NO_ARGS) @@ -8381,19 +8482,25 @@ int main() int main(int argc, char** argv) #endif { - int ret = 0; -#ifndef MAIN_NO_ARGS - int optMatched; #ifdef WOLFSSL_ESPIDF int argc = construct_argv(); char** argv = (char**)__argv; #endif + return wolfcrypt_benchmark_main(argc, argv); +} +#endif /* NO_MAIN_FUNCTION */ + +int wolfcrypt_benchmark_main(int argc, char** argv) +{ + int ret = 0; +#ifndef MAIN_NO_ARGS + int optMatched; #ifndef WOLFSSL_BENCHMARK_ALL int i; #endif #endif - benchmark_static_init(); + benchmark_static_init(1); printf("------------------------------------------------------------------------------\n"); printf(" wolfSSL version %s\n", LIBWOLFSSL_VERSION_STRING); @@ -8427,7 +8534,17 @@ int main(int argc, char** argv) base2 = 0; #if defined(HAVE_AESGCM) || defined(HAVE_AESCCM) else if (string_matches(argv[1], "-no_aad")) - aesAuthAddSz = 0; + aes_aad_options = AAD_SIZE_ZERO; + else if (string_matches(argv[1], "-all_aad")) + aes_aad_options |= AAD_SIZE_ZERO | AAD_SIZE_DEFAULT; + else if (string_matches(argv[1], "-aad_size")) { + argc--; + argv++; + if (argc > 1) { + aes_aad_size = XATOI(argv[1]); + aes_aad_options |= AAD_SIZE_CUSTOM; + } + } #endif else if (string_matches(argv[1], "-dgst_full")) digest_stream = 0; @@ -8482,6 +8599,12 @@ int main(int argc, char** argv) gPrintStats = 1; } #endif + else if (string_matches(argv[1], "-blocks")) { + argc--; + argv++; + if (argc > 1) + numBlocks = XATOI(argv[1]); + } else if (argv[1][0] == '-') { optMatched = 0; #ifndef WOLFSSL_BENCHMARK_ALL @@ -8588,7 +8711,7 @@ int main(int argc, char** argv) #endif /* !NO_MAIN_DRIVER */ #else - #ifndef NO_MAIN_DRIVER + #if !defined(NO_MAIN_DRIVER) && !defined(NO_MAIN_FUNCTION) int main(void) { return 0; } #endif #endif /* !NO_CRYPT_BENCHMARK */ diff --git a/wolfcrypt/benchmark/benchmark.h b/wolfcrypt/benchmark/benchmark.h index 341c021ee..3d5a1ea2c 100644 --- a/wolfcrypt/benchmark/benchmark.h +++ b/wolfcrypt/benchmark/benchmark.h @@ -36,6 +36,9 @@ THREAD_RETURN WOLFSSL_THREAD benchmark_test(void* args); #else int benchmark_test(void *args); #endif +#ifndef NO_MAIN_DRIVER +int wolfcrypt_benchmark_main(int argc, char** argv); +#endif /* individual benchmarks */ int benchmark_init(void); @@ -49,7 +52,7 @@ void bench_chacha20_poly1305_aead(void); void bench_aescbc(int useDeviceID); void bench_aesgcm(int useDeviceID); void bench_gmac(void); -void bench_aesccm(void); +void bench_aesccm(int dummy); void bench_aesecb(int useDeviceID); void bench_aesxts(void); void bench_aesctr(void); From 0e57e9858fd402ac6c23eff7ea86d84175aa34cf Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Fri, 20 May 2022 14:28:39 +0200 Subject: [PATCH 3/4] Integrate Xilinx Versal * add Versal specific glue The same structure of an "XSecure client" is used throughout the API's, therefor define it once and re-use in all clients. * integrate Versal AES-GCM engine * integrate Versal SHA3-384 engine * add versal support to tests - There's no intermediate-hash API for Versal. * add specific test with large AAD Test only with `n*16 byte` wide chunks of AAD, so it gets processed in the hardware engine. * add specific test with misaligned AES-GCM arguments * integrate Versal RSA engine * disable failing RSA test-case when Xilinx Crypto is enabled * introduce define `WOLFSSL_XILINX_CRYPT_VERSAL` * integrate Versal TRNG engine * allow using Versal TRNG w/o wolfcrypt DRBG Versal TRNG already provides a HRNG mode which does the same as the wolfcrypt DRBG implementation. * add support for user-supplied nonce to Versal TRNG * add `wc_XsecureErrorToString()` to map PLM error codes to messages. * integrate Versal EcDSA engine * update tests to work with Versal EcDSA If deterministic K is enabled, the tests failed here since the Versal EcDSA engine doesn't support the SECP256R1 curve yet. * Xilinx crypto engines like aligned memory very much Make this a default choice, not via the user configuration. * add Xilinx-specific `WOLFSSL_MSG()` equivalent `WOLFSSL_XIL_MSG()` does the same as `WOLFSSL_MSG()` besides waiting for 1 second before printing to stdout, since the PLM maybe prints to same and outputs would be mixed up. This waiting can be disabled by defining `WOLFSSL_XIL_MSG_NO_SLEEP`. * add option to enable DPA CounterMeasures in AES-GCM crypto engine * add "command mode" to Xilinx bare-metal example * update Xilinx default user settings * add script to execute benchmarks * add scripts to create graphics * add Vitis 2022.1 example projects Signed-off-by: Steffen Jaeckel --- .gitignore | 3 + IDE/XilinxSDK/2022_1/.gitignore | 9 + .../wolfCrypt_FreeRTOS_example/.cproject | 436 ++++ .../wolfCrypt_FreeRTOS_example/.project | 1859 +++++++++++++++++ .../wolfCrypt_FreeRTOS_example.prj | 12 + .../.cproject | 108 + .../.project | 29 + .../wolfCrypt_FreeRTOS_example_system.sprj | 23 + .../2022_1/wolfCrypt_example/.cproject | 432 ++++ .../2022_1/wolfCrypt_example/.project | 1859 +++++++++++++++++ .../wolfCrypt_example/wolfCrypt_example.prj | 12 + .../2022_1/wolfCrypt_example_system/.cproject | 108 + .../2022_1/wolfCrypt_example_system/.project | 29 + .../wolfCrypt_example_system.sprj | 23 + IDE/XilinxSDK/README.md | 78 +- IDE/XilinxSDK/bench.sh | 76 + IDE/XilinxSDK/combine.sh | 81 + IDE/XilinxSDK/eclipse_formatter_profile.xml | 168 ++ IDE/XilinxSDK/graph.sh | 327 +++ IDE/XilinxSDK/include.am | 11 + IDE/XilinxSDK/user_settings.h | 60 +- IDE/XilinxSDK/wolfssl_example.c | 134 +- scripts/bench/bench_functions.sh | 137 ++ scripts/include.am | 2 + wolfcrypt/src/ecc.c | 310 ++- wolfcrypt/src/include.am | 2 + wolfcrypt/src/port/xilinx/xil-aesgcm.c | 445 +++- wolfcrypt/src/port/xilinx/xil-sha3.c | 78 + wolfcrypt/src/port/xilinx/xil-versal-glue.c | 211 ++ wolfcrypt/src/port/xilinx/xil-versal-trng.c | 227 ++ wolfcrypt/src/random.c | 14 + wolfcrypt/src/rsa.c | 68 +- wolfcrypt/src/signature.c | 2 +- wolfcrypt/test/test.c | 138 +- wolfssl/wolfcrypt/aes.h | 17 +- wolfssl/wolfcrypt/ecc.h | 12 +- wolfssl/wolfcrypt/include.am | 2 + wolfssl/wolfcrypt/port/xilinx/xil-sha3.h | 14 +- .../wolfcrypt/port/xilinx/xil-versal-glue.h | 101 + .../wolfcrypt/port/xilinx/xil-versal-trng.h | 44 + wolfssl/wolfcrypt/rsa.h | 11 +- wolfssl/wolfcrypt/settings.h | 4 +- wolfssl/wolfcrypt/types.h | 3 +- 43 files changed, 7597 insertions(+), 122 deletions(-) create mode 100644 IDE/XilinxSDK/2022_1/.gitignore create mode 100644 IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.cproject create mode 100644 IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.project create mode 100644 IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/wolfCrypt_FreeRTOS_example.prj create mode 100644 IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example_system/.cproject create mode 100644 IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example_system/.project create mode 100644 IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example_system/wolfCrypt_FreeRTOS_example_system.sprj create mode 100644 IDE/XilinxSDK/2022_1/wolfCrypt_example/.cproject create mode 100644 IDE/XilinxSDK/2022_1/wolfCrypt_example/.project create mode 100644 IDE/XilinxSDK/2022_1/wolfCrypt_example/wolfCrypt_example.prj create mode 100644 IDE/XilinxSDK/2022_1/wolfCrypt_example_system/.cproject create mode 100644 IDE/XilinxSDK/2022_1/wolfCrypt_example_system/.project create mode 100644 IDE/XilinxSDK/2022_1/wolfCrypt_example_system/wolfCrypt_example_system.sprj create mode 100755 IDE/XilinxSDK/bench.sh create mode 100755 IDE/XilinxSDK/combine.sh create mode 100644 IDE/XilinxSDK/eclipse_formatter_profile.xml create mode 100755 IDE/XilinxSDK/graph.sh create mode 100755 scripts/bench/bench_functions.sh create mode 100644 wolfcrypt/src/port/xilinx/xil-versal-glue.c create mode 100644 wolfcrypt/src/port/xilinx/xil-versal-trng.c create mode 100644 wolfssl/wolfcrypt/port/xilinx/xil-versal-glue.h create mode 100644 wolfssl/wolfcrypt/port/xilinx/xil-versal-trng.h diff --git a/.gitignore b/.gitignore index 49238abcc..0f9b391cb 100644 --- a/.gitignore +++ b/.gitignore @@ -379,6 +379,9 @@ IDE/XCODE/Index /IDE/QNX/example-cmac/cmac-test /IDE/QNX/CAAM-DRIVER/wolfCrypt +# Xilinx +/IDE/XilinxSDK/data + # Emacs *~ diff --git a/IDE/XilinxSDK/2022_1/.gitignore b/IDE/XilinxSDK/2022_1/.gitignore new file mode 100644 index 000000000..8fae7550d --- /dev/null +++ b/IDE/XilinxSDK/2022_1/.gitignore @@ -0,0 +1,9 @@ +.analytics +.metadata/ +_ide/ +Debug/ +Release/ +*/.gitignore + +vmk180/ +*.ld diff --git a/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.cproject b/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.cproject new file mode 100644 index 000000000..1741fb770 --- /dev/null +++ b/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.cproject @@ -0,0 +1,436 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.project b/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.project new file mode 100644 index 000000000..23ce39a74 --- /dev/null +++ b/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/.project @@ -0,0 +1,1859 @@ + + + wolfCrypt_FreeRTOS_example + Created by Vitis v2022.1 + + vmk180 + + + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + + + com.xilinx.sdx.sdk.core.SdkProjectNature + org.eclipse.cdt.core.cnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature + + + + inc + 2 + virtual:/virtual + + + inc/wolfssl + 2 + virtual:/virtual + + + src/IDE + 2 + virtual:/virtual + + + src/wolfcrypt + 2 + virtual:/virtual + + + inc/wolfssl/callbacks.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/callbacks.h + + + inc/wolfssl/certs_test.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/certs_test.h + + + inc/wolfssl/crl.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/crl.h + + + inc/wolfssl/error-ssl.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/error-ssl.h + + + inc/wolfssl/include.am + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/include.am + + + inc/wolfssl/internal.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/internal.h + + + inc/wolfssl/ocsp.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/ocsp.h + + + inc/wolfssl/openssl + 2 + virtual:/virtual + + + inc/wolfssl/options.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/options.h + + + inc/wolfssl/options.h.in + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/options.h.in + + + inc/wolfssl/quic.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/quic.h + + + inc/wolfssl/sniffer.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/sniffer.h + + + inc/wolfssl/sniffer_error.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/sniffer_error.h + + + inc/wolfssl/sniffer_error.rc + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/sniffer_error.rc + + + inc/wolfssl/ssl.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/ssl.h + + + inc/wolfssl/test.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/test.h + + + inc/wolfssl/version.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/version.h + + + inc/wolfssl/version.h.in + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/version.h.in + + + inc/wolfssl/wolfcrypt + 2 + virtual:/virtual + + + inc/wolfssl/wolfio.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfio.h + + + src/IDE/XilinxSDK + 2 + virtual:/virtual + + + src/wolfcrypt/benchmark + 2 + virtual:/virtual + + + src/wolfcrypt/src + 2 + virtual:/virtual + + + src/wolfcrypt/test + 2 + virtual:/virtual + + + inc/wolfssl/openssl/aes.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/aes.h + + + inc/wolfssl/openssl/asn1.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/asn1.h + + + inc/wolfssl/openssl/asn1t.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/asn1t.h + + + inc/wolfssl/openssl/bio.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/bio.h + + + inc/wolfssl/openssl/bn.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/bn.h + + + inc/wolfssl/openssl/buffer.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/buffer.h + + + inc/wolfssl/openssl/camellia.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/camellia.h + + + inc/wolfssl/openssl/cmac.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/cmac.h + + + inc/wolfssl/openssl/cms.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/cms.h + + + inc/wolfssl/openssl/compat_types.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/compat_types.h + + + inc/wolfssl/openssl/conf.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/conf.h + + + inc/wolfssl/openssl/crypto.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/crypto.h + + + inc/wolfssl/openssl/des.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/des.h + + + inc/wolfssl/openssl/dh.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/dh.h + + + inc/wolfssl/openssl/dsa.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/dsa.h + + + inc/wolfssl/openssl/ec.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ec.h + + + inc/wolfssl/openssl/ec25519.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ec25519.h + + + inc/wolfssl/openssl/ec448.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ec448.h + + + inc/wolfssl/openssl/ecdh.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ecdh.h + + + inc/wolfssl/openssl/ecdsa.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ecdsa.h + + + inc/wolfssl/openssl/ed25519.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ed25519.h + + + inc/wolfssl/openssl/ed448.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ed448.h + + + inc/wolfssl/openssl/engine.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/engine.h + + + inc/wolfssl/openssl/err.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/err.h + + + inc/wolfssl/openssl/evp.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/evp.h + + + inc/wolfssl/openssl/fips_rand.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/fips_rand.h + + + inc/wolfssl/openssl/hmac.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/hmac.h + + + inc/wolfssl/openssl/include.am + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/include.am + + + inc/wolfssl/openssl/kdf.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/kdf.h + + + inc/wolfssl/openssl/lhash.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/lhash.h + + + inc/wolfssl/openssl/md4.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/md4.h + + + inc/wolfssl/openssl/md5.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/md5.h + + + inc/wolfssl/openssl/modes.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/modes.h + + + inc/wolfssl/openssl/obj_mac.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/obj_mac.h + + + inc/wolfssl/openssl/objects.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/objects.h + + + inc/wolfssl/openssl/ocsp.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ocsp.h + + + inc/wolfssl/openssl/opensslconf.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/opensslconf.h + + + inc/wolfssl/openssl/opensslv.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/opensslv.h + + + inc/wolfssl/openssl/ossl_typ.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ossl_typ.h + + + inc/wolfssl/openssl/pem.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/pem.h + + + inc/wolfssl/openssl/pkcs12.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/pkcs12.h + + + inc/wolfssl/openssl/pkcs7.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/pkcs7.h + + + inc/wolfssl/openssl/rand.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/rand.h + + + inc/wolfssl/openssl/rc4.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/rc4.h + + + inc/wolfssl/openssl/ripemd.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ripemd.h + + + inc/wolfssl/openssl/rsa.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/rsa.h + + + inc/wolfssl/openssl/sha.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/sha.h + + + inc/wolfssl/openssl/sha3.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/sha3.h + + + inc/wolfssl/openssl/srp.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/srp.h + + + inc/wolfssl/openssl/ssl.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ssl.h + + + inc/wolfssl/openssl/ssl23.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ssl23.h + + + inc/wolfssl/openssl/stack.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/stack.h + + + inc/wolfssl/openssl/tls1.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/tls1.h + + + inc/wolfssl/openssl/txt_db.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/txt_db.h + + + inc/wolfssl/openssl/ui.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/ui.h + + + inc/wolfssl/openssl/x509.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/x509.h + + + inc/wolfssl/openssl/x509_vfy.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/x509_vfy.h + + + inc/wolfssl/openssl/x509v3.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/openssl/x509v3.h + + + inc/wolfssl/wolfcrypt/aes.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/aes.h + + + inc/wolfssl/wolfcrypt/arc4.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/arc4.h + + + inc/wolfssl/wolfcrypt/asn.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/asn.h + + + inc/wolfssl/wolfcrypt/asn_public.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/asn_public.h + + + inc/wolfssl/wolfcrypt/async.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/async.h + + + inc/wolfssl/wolfcrypt/blake2-impl.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/blake2-impl.h + + + inc/wolfssl/wolfcrypt/blake2-int.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/blake2-int.h + + + inc/wolfssl/wolfcrypt/blake2.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/blake2.h + + + inc/wolfssl/wolfcrypt/camellia.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/camellia.h + + + inc/wolfssl/wolfcrypt/chacha.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/chacha.h + + + inc/wolfssl/wolfcrypt/chacha20_poly1305.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/chacha20_poly1305.h + + + inc/wolfssl/wolfcrypt/cmac.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/cmac.h + + + inc/wolfssl/wolfcrypt/coding.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/coding.h + + + inc/wolfssl/wolfcrypt/compress.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/compress.h + + + inc/wolfssl/wolfcrypt/cpuid.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/cpuid.h + + + inc/wolfssl/wolfcrypt/cryptocb.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/cryptocb.h + + + inc/wolfssl/wolfcrypt/curve25519.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/curve25519.h + + + inc/wolfssl/wolfcrypt/curve448.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/curve448.h + + + inc/wolfssl/wolfcrypt/des3.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/des3.h + + + inc/wolfssl/wolfcrypt/dh.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/dh.h + + + inc/wolfssl/wolfcrypt/dilithium.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/dilithium.h + + + inc/wolfssl/wolfcrypt/dsa.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/dsa.h + + + inc/wolfssl/wolfcrypt/ecc.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/ecc.h + + + inc/wolfssl/wolfcrypt/eccsi.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/eccsi.h + + + inc/wolfssl/wolfcrypt/ed25519.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/ed25519.h + + + inc/wolfssl/wolfcrypt/ed448.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/ed448.h + + + inc/wolfssl/wolfcrypt/error-crypt.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/error-crypt.h + + + inc/wolfssl/wolfcrypt/falcon.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/falcon.h + + + inc/wolfssl/wolfcrypt/fe_448.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/fe_448.h + + + inc/wolfssl/wolfcrypt/fe_operations.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/fe_operations.h + + + inc/wolfssl/wolfcrypt/fips.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/fips.h + + + inc/wolfssl/wolfcrypt/fips_test.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/fips_test.h + + + inc/wolfssl/wolfcrypt/ge_448.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/ge_448.h + + + inc/wolfssl/wolfcrypt/ge_operations.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/ge_operations.h + + + inc/wolfssl/wolfcrypt/hash.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/hash.h + + + inc/wolfssl/wolfcrypt/hmac.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/hmac.h + + + inc/wolfssl/wolfcrypt/include.am + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/include.am + + + inc/wolfssl/wolfcrypt/integer.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/integer.h + + + inc/wolfssl/wolfcrypt/kdf.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/kdf.h + + + inc/wolfssl/wolfcrypt/logging.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/logging.h + + + inc/wolfssl/wolfcrypt/md2.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/md2.h + + + inc/wolfssl/wolfcrypt/md4.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/md4.h + + + inc/wolfssl/wolfcrypt/md5.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/md5.h + + + inc/wolfssl/wolfcrypt/mem_track.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/mem_track.h + + + inc/wolfssl/wolfcrypt/memory.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/memory.h + + + inc/wolfssl/wolfcrypt/misc.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/misc.h + + + inc/wolfssl/wolfcrypt/mpi_class.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/mpi_class.h + + + inc/wolfssl/wolfcrypt/mpi_superclass.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/mpi_superclass.h + + + inc/wolfssl/wolfcrypt/pkcs11.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/pkcs11.h + + + inc/wolfssl/wolfcrypt/pkcs12.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/pkcs12.h + + + inc/wolfssl/wolfcrypt/pkcs7.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/pkcs7.h + + + inc/wolfssl/wolfcrypt/poly1305.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/poly1305.h + + + inc/wolfssl/wolfcrypt/port + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/pwdbased.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/pwdbased.h + + + inc/wolfssl/wolfcrypt/random.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/random.h + + + inc/wolfssl/wolfcrypt/rc2.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/rc2.h + + + inc/wolfssl/wolfcrypt/ripemd.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/ripemd.h + + + inc/wolfssl/wolfcrypt/rsa.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/rsa.h + + + inc/wolfssl/wolfcrypt/sakke.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/sakke.h + + + inc/wolfssl/wolfcrypt/selftest.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/selftest.h + + + inc/wolfssl/wolfcrypt/settings.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/settings.h + + + inc/wolfssl/wolfcrypt/sha.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/sha.h + + + inc/wolfssl/wolfcrypt/sha256.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/sha256.h + + + inc/wolfssl/wolfcrypt/sha3.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/sha3.h + + + inc/wolfssl/wolfcrypt/sha512.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/sha512.h + + + inc/wolfssl/wolfcrypt/signature.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/signature.h + + + inc/wolfssl/wolfcrypt/siphash.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/siphash.h + + + inc/wolfssl/wolfcrypt/sp.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/sp.h + + + inc/wolfssl/wolfcrypt/sp_int.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/sp_int.h + + + inc/wolfssl/wolfcrypt/srp.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/srp.h + + + inc/wolfssl/wolfcrypt/tfm.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/tfm.h + + + inc/wolfssl/wolfcrypt/types.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/types.h + + + inc/wolfssl/wolfcrypt/visibility.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/visibility.h + + + inc/wolfssl/wolfcrypt/wc_encrypt.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/wc_encrypt.h + + + inc/wolfssl/wolfcrypt/wc_pkcs11.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/wc_pkcs11.h + + + inc/wolfssl/wolfcrypt/wc_port.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/wc_port.h + + + inc/wolfssl/wolfcrypt/wolfevent.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/wolfevent.h + + + inc/wolfssl/wolfcrypt/wolfmath.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/wolfmath.h + + + src/IDE/XilinxSDK/user_settings.h + 1 + PARENT-1-WORKSPACE_LOC/user_settings.h + + + src/IDE/XilinxSDK/wolfssl_example.c + 1 + PARENT-1-WORKSPACE_LOC/wolfssl_example.c + + + src/wolfcrypt/benchmark/benchmark.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/benchmark/benchmark.c + + + src/wolfcrypt/benchmark/benchmark.h + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/benchmark/benchmark.h + + + src/wolfcrypt/src/aes.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/aes.c + + + src/wolfcrypt/src/arc4.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/arc4.c + + + src/wolfcrypt/src/asm.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/asm.c + + + src/wolfcrypt/src/asn.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/asn.c + + + src/wolfcrypt/src/blake2b.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/blake2b.c + + + src/wolfcrypt/src/blake2s.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/blake2s.c + + + src/wolfcrypt/src/camellia.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/camellia.c + + + src/wolfcrypt/src/chacha.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/chacha.c + + + src/wolfcrypt/src/chacha20_poly1305.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/chacha20_poly1305.c + + + src/wolfcrypt/src/cmac.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/cmac.c + + + src/wolfcrypt/src/coding.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/coding.c + + + src/wolfcrypt/src/compress.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/compress.c + + + src/wolfcrypt/src/cpuid.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/cpuid.c + + + src/wolfcrypt/src/cryptocb.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/cryptocb.c + + + src/wolfcrypt/src/curve25519.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/curve25519.c + + + src/wolfcrypt/src/curve448.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/curve448.c + + + src/wolfcrypt/src/des3.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/des3.c + + + src/wolfcrypt/src/dh.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/dh.c + + + src/wolfcrypt/src/dsa.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/dsa.c + + + src/wolfcrypt/src/ecc.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/ecc.c + + + src/wolfcrypt/src/ecc_fp.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/ecc_fp.c + + + src/wolfcrypt/src/eccsi.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/eccsi.c + + + src/wolfcrypt/src/ed25519.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/ed25519.c + + + src/wolfcrypt/src/ed448.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/ed448.c + + + src/wolfcrypt/src/error.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/error.c + + + src/wolfcrypt/src/evp.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/evp.c + + + src/wolfcrypt/src/falcon.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/falcon.c + + + src/wolfcrypt/src/fe_448.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fe_448.c + + + src/wolfcrypt/src/fe_low_mem.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fe_low_mem.c + + + src/wolfcrypt/src/fe_operations.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fe_operations.c + + + src/wolfcrypt/src/fe_x25519_128.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fe_x25519_128.i + + + src/wolfcrypt/src/fp_mont_small.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mont_small.i + + + src/wolfcrypt/src/fp_mul_comba_12.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_12.i + + + src/wolfcrypt/src/fp_mul_comba_17.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_17.i + + + src/wolfcrypt/src/fp_mul_comba_20.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_20.i + + + src/wolfcrypt/src/fp_mul_comba_24.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_24.i + + + src/wolfcrypt/src/fp_mul_comba_28.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_28.i + + + src/wolfcrypt/src/fp_mul_comba_3.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_3.i + + + src/wolfcrypt/src/fp_mul_comba_32.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_32.i + + + src/wolfcrypt/src/fp_mul_comba_4.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_4.i + + + src/wolfcrypt/src/fp_mul_comba_48.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_48.i + + + src/wolfcrypt/src/fp_mul_comba_6.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_6.i + + + src/wolfcrypt/src/fp_mul_comba_64.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_64.i + + + src/wolfcrypt/src/fp_mul_comba_7.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_7.i + + + src/wolfcrypt/src/fp_mul_comba_8.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_8.i + + + src/wolfcrypt/src/fp_mul_comba_9.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_9.i + + + src/wolfcrypt/src/fp_mul_comba_small_set.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_mul_comba_small_set.i + + + src/wolfcrypt/src/fp_sqr_comba_12.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_12.i + + + src/wolfcrypt/src/fp_sqr_comba_17.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_17.i + + + src/wolfcrypt/src/fp_sqr_comba_20.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_20.i + + + src/wolfcrypt/src/fp_sqr_comba_24.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_24.i + + + src/wolfcrypt/src/fp_sqr_comba_28.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_28.i + + + src/wolfcrypt/src/fp_sqr_comba_3.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_3.i + + + src/wolfcrypt/src/fp_sqr_comba_32.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_32.i + + + src/wolfcrypt/src/fp_sqr_comba_4.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_4.i + + + src/wolfcrypt/src/fp_sqr_comba_48.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_48.i + + + src/wolfcrypt/src/fp_sqr_comba_6.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_6.i + + + src/wolfcrypt/src/fp_sqr_comba_64.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_64.i + + + src/wolfcrypt/src/fp_sqr_comba_7.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_7.i + + + src/wolfcrypt/src/fp_sqr_comba_8.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_8.i + + + src/wolfcrypt/src/fp_sqr_comba_9.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_9.i + + + src/wolfcrypt/src/fp_sqr_comba_small_set.i + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/fp_sqr_comba_small_set.i + + + src/wolfcrypt/src/ge_448.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/ge_448.c + + + src/wolfcrypt/src/ge_low_mem.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/ge_low_mem.c + + + src/wolfcrypt/src/ge_operations.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/ge_operations.c + + + src/wolfcrypt/src/hash.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/hash.c + + + src/wolfcrypt/src/hmac.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/hmac.c + + + src/wolfcrypt/src/integer.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/integer.c + + + src/wolfcrypt/src/kdf.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/kdf.c + + + src/wolfcrypt/src/logging.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/logging.c + + + src/wolfcrypt/src/md2.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/md2.c + + + src/wolfcrypt/src/md4.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/md4.c + + + src/wolfcrypt/src/md5.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/md5.c + + + src/wolfcrypt/src/memory.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/memory.c + + + src/wolfcrypt/src/misc.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/misc.c + + + src/wolfcrypt/src/pkcs12.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/pkcs12.c + + + src/wolfcrypt/src/pkcs7.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/pkcs7.c + + + src/wolfcrypt/src/poly1305.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/poly1305.c + + + src/wolfcrypt/src/port + 2 + virtual:/virtual + + + src/wolfcrypt/src/pwdbased.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/pwdbased.c + + + src/wolfcrypt/src/random.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/random.c + + + src/wolfcrypt/src/rc2.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/rc2.c + + + src/wolfcrypt/src/ripemd.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/ripemd.c + + + src/wolfcrypt/src/rsa.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/rsa.c + + + src/wolfcrypt/src/sakke.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sakke.c + + + src/wolfcrypt/src/sha.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sha.c + + + src/wolfcrypt/src/sha256.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sha256.c + + + src/wolfcrypt/src/sha3.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sha3.c + + + src/wolfcrypt/src/sha512.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sha512.c + + + src/wolfcrypt/src/signature.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/signature.c + + + src/wolfcrypt/src/siphash.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/siphash.c + + + src/wolfcrypt/src/sp_arm32.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sp_arm32.c + + + src/wolfcrypt/src/sp_arm64.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sp_arm64.c + + + src/wolfcrypt/src/sp_armthumb.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sp_armthumb.c + + + src/wolfcrypt/src/sp_c32.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sp_c32.c + + + src/wolfcrypt/src/sp_c64.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sp_c64.c + + + src/wolfcrypt/src/sp_cortexm.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sp_cortexm.c + + + src/wolfcrypt/src/sp_dsp32.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sp_dsp32.c + + + src/wolfcrypt/src/sp_int.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/sp_int.c + + + src/wolfcrypt/src/srp.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/srp.c + + + src/wolfcrypt/src/tfm.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/tfm.c + + + src/wolfcrypt/src/wc_dsp.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wc_dsp.c + + + src/wolfcrypt/src/wc_encrypt.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wc_encrypt.c + + + src/wolfcrypt/src/wc_pkcs11.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wc_pkcs11.c + + + src/wolfcrypt/src/wc_port.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wc_port.c + + + src/wolfcrypt/src/wolfevent.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfevent.c + + + src/wolfcrypt/src/wolfmath.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/wolfmath.c + + + src/wolfcrypt/test/test.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/test/test.c + + + src/wolfcrypt/test/test.h + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/test/test.h + + + inc/wolfssl/wolfcrypt/port/Espressif + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/Renesas + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/af_alg + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/arm + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/atmel + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/caam + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/cavium + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/cypress + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/devcrypto + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/intel + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/iotsafe + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/kcapi + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/nrf51.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/nrf51.h + + + inc/wolfssl/wolfcrypt/port/nxp + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/pic32 + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/psa + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/silabs + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/st + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/ti + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/xilinx + 2 + virtual:/virtual + + + src/wolfcrypt/src/port/arm + 2 + virtual:/virtual + + + src/wolfcrypt/src/port/xilinx + 2 + virtual:/virtual + + + inc/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/Espressif/esp32-crypt.h + + + inc/wolfssl/wolfcrypt/port/Renesas/renesas-sce-crypt.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/Renesas/renesas-sce-crypt.h + + + inc/wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h + + + inc/wolfssl/wolfcrypt/port/Renesas/renesas_cmn.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/Renesas/renesas_cmn.h + + + inc/wolfssl/wolfcrypt/port/Renesas/renesas_sync.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/Renesas/renesas_sync.h + + + inc/wolfssl/wolfcrypt/port/Renesas/renesas_tsip_types.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/Renesas/renesas_tsip_types.h + + + inc/wolfssl/wolfcrypt/port/af_alg/afalg_hash.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/af_alg/afalg_hash.h + + + inc/wolfssl/wolfcrypt/port/af_alg/wc_afalg.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/af_alg/wc_afalg.h + + + inc/wolfssl/wolfcrypt/port/arm/cryptoCell.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/arm/cryptoCell.h + + + inc/wolfssl/wolfcrypt/port/atmel/atmel.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/atmel/atmel.h + + + inc/wolfssl/wolfcrypt/port/caam/caam_driver.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/caam_driver.h + + + inc/wolfssl/wolfcrypt/port/caam/caam_error.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/caam_error.h + + + inc/wolfssl/wolfcrypt/port/caam/caam_qnx.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/caam_qnx.h + + + inc/wolfssl/wolfcrypt/port/caam/wolfcaam.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/wolfcaam.h + + + inc/wolfssl/wolfcrypt/port/caam/wolfcaam_aes.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/wolfcaam_aes.h + + + inc/wolfssl/wolfcrypt/port/caam/wolfcaam_cmac.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/wolfcaam_cmac.h + + + inc/wolfssl/wolfcrypt/port/caam/wolfcaam_ecdsa.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/wolfcaam_ecdsa.h + + + inc/wolfssl/wolfcrypt/port/caam/wolfcaam_hash.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/wolfcaam_hash.h + + + inc/wolfssl/wolfcrypt/port/caam/wolfcaam_qnx.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/wolfcaam_qnx.h + + + inc/wolfssl/wolfcrypt/port/caam/wolfcaam_rsa.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/wolfcaam_rsa.h + + + inc/wolfssl/wolfcrypt/port/caam/wolfcaam_seco.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/wolfcaam_seco.h + + + inc/wolfssl/wolfcrypt/port/caam/wolfcaam_sha.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/wolfcaam_sha.h + + + inc/wolfssl/wolfcrypt/port/caam/wolfcaam_x25519.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/caam/wolfcaam_x25519.h + + + inc/wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h + + + inc/wolfssl/wolfcrypt/port/cavium/cavium_octeon_sync.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/cavium/cavium_octeon_sync.h + + + inc/wolfssl/wolfcrypt/port/cypress/psoc6_crypto.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/cypress/psoc6_crypto.h + + + inc/wolfssl/wolfcrypt/port/devcrypto/wc_devcrypto.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/devcrypto/wc_devcrypto.h + + + inc/wolfssl/wolfcrypt/port/intel/quickassist.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/intel/quickassist.h + + + inc/wolfssl/wolfcrypt/port/intel/quickassist_mem.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/intel/quickassist_mem.h + + + inc/wolfssl/wolfcrypt/port/intel/quickassist_sync.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/intel/quickassist_sync.h + + + inc/wolfssl/wolfcrypt/port/iotsafe/iotsafe.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/iotsafe/iotsafe.h + + + inc/wolfssl/wolfcrypt/port/kcapi/kcapi_dh.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/kcapi/kcapi_dh.h + + + inc/wolfssl/wolfcrypt/port/kcapi/kcapi_ecc.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/kcapi/kcapi_ecc.h + + + inc/wolfssl/wolfcrypt/port/kcapi/kcapi_hash.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/kcapi/kcapi_hash.h + + + inc/wolfssl/wolfcrypt/port/kcapi/kcapi_hmac.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/kcapi/kcapi_hmac.h + + + inc/wolfssl/wolfcrypt/port/kcapi/kcapi_rsa.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/kcapi/kcapi_rsa.h + + + inc/wolfssl/wolfcrypt/port/kcapi/wc_kcapi.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/kcapi/wc_kcapi.h + + + inc/wolfssl/wolfcrypt/port/nxp/dcp_port.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/nxp/dcp_port.h + + + inc/wolfssl/wolfcrypt/port/nxp/ksdk_port.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/nxp/ksdk_port.h + + + inc/wolfssl/wolfcrypt/port/nxp/se050_port.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/nxp/se050_port.h + + + inc/wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/pic32/pic32mz-crypt.h + + + inc/wolfssl/wolfcrypt/port/psa/psa.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/psa/psa.h + + + inc/wolfssl/wolfcrypt/port/silabs/silabs_aes.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/silabs/silabs_aes.h + + + inc/wolfssl/wolfcrypt/port/silabs/silabs_ecc.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/silabs/silabs_ecc.h + + + inc/wolfssl/wolfcrypt/port/silabs/silabs_hash.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/silabs/silabs_hash.h + + + inc/wolfssl/wolfcrypt/port/silabs/silabs_random.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/silabs/silabs_random.h + + + inc/wolfssl/wolfcrypt/port/st/stm32.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/st/stm32.h + + + inc/wolfssl/wolfcrypt/port/st/stsafe.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/st/stsafe.h + + + inc/wolfssl/wolfcrypt/port/ti/ti-ccm.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/ti/ti-ccm.h + + + inc/wolfssl/wolfcrypt/port/ti/ti-hash.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/ti/ti-hash.h + + + inc/wolfssl/wolfcrypt/port/xilinx/xil-sha3.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/xilinx/xil-sha3.h + + + inc/wolfssl/wolfcrypt/port/xilinx/xil-versal-glue.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/xilinx/xil-versal-glue.h + + + inc/wolfssl/wolfcrypt/port/xilinx/xil-versal-trng.h + 1 + PARENT-3-WORKSPACE_LOC/wolfssl/wolfcrypt/port/xilinx/xil-versal-trng.h + + + src/wolfcrypt/src/port/arm/armv8-aes.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/arm/armv8-aes.c + + + src/wolfcrypt/src/port/arm/armv8-chacha.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/arm/armv8-chacha.c + + + src/wolfcrypt/src/port/arm/armv8-curve25519_c.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/arm/armv8-curve25519_c.c + + + src/wolfcrypt/src/port/arm/armv8-poly1305.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/arm/armv8-poly1305.c + + + src/wolfcrypt/src/port/arm/armv8-sha256.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/arm/armv8-sha256.c + + + src/wolfcrypt/src/port/arm/armv8-sha3-asm_c.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/arm/armv8-sha3-asm_c.c + + + src/wolfcrypt/src/port/arm/armv8-sha512-asm_c.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/arm/armv8-sha512-asm_c.c + + + src/wolfcrypt/src/port/arm/armv8-sha512.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/arm/armv8-sha512.c + + + src/wolfcrypt/src/port/arm/cryptoCell.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/arm/cryptoCell.c + + + src/wolfcrypt/src/port/arm/cryptoCellHash.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/arm/cryptoCellHash.c + + + src/wolfcrypt/src/port/xilinx/xil-aesgcm.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/xilinx/xil-aesgcm.c + + + src/wolfcrypt/src/port/xilinx/xil-sha3.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/xilinx/xil-sha3.c + + + src/wolfcrypt/src/port/xilinx/xil-versal-glue.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/xilinx/xil-versal-glue.c + + + src/wolfcrypt/src/port/xilinx/xil-versal-trng.c + 1 + PARENT-3-WORKSPACE_LOC/wolfcrypt/src/port/xilinx/xil-versal-trng.c + + + diff --git a/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/wolfCrypt_FreeRTOS_example.prj b/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/wolfCrypt_FreeRTOS_example.prj new file mode 100644 index 000000000..6e18f802d --- /dev/null +++ b/IDE/XilinxSDK/2022_1/wolfCrypt_FreeRTOS_example/wolfCrypt_FreeRTOS_example.prj @@ -0,0 +1,12 @@ + + + + + + + + + + +