Commit Graph

654 Commits (devin/1739920896-esp32-fixes)

Author SHA1 Message Date
Anthony Hu 1608cb8b45 More ating on HAVE_SPHINCS in benchmarks 2023-08-23 14:03:22 -04:00
jordan 779b87f03a Tiny cleanup to benchmark print usage. 2023-08-10 09:47:07 -05:00
Juliusz Sosinowicz 67d6d438c5 Port testing to wolfSSL threading interface 2023-08-04 10:49:39 +02:00
billphipps 10adca1a45
Add CryptoCb features (#6636)
* Update to support invoking cryptocb during un/register.
2023-07-27 13:16:43 -07:00
JacobBarthelmeh 1285ae7816
Merge pull request #6506 from DimitriPapadopoulos/codespell
Fix typos found by codespell
2023-07-24 10:34:29 -06:00
JacobBarthelmeh 8065ba18f9
Merge pull request #6620 from douzzer/20230714-WC_DO_NOTHING
20230714-WC_DO_NOTHING
2023-07-18 17:04:02 -06:00
JacobBarthelmeh a026d843cf
Merge pull request #6564 from philljj/add_lms_hooks
Add LMS/HSS wolfCrypt hooks.
2023-07-14 14:33:25 -06:00
jordan a747e7773c LMS: comments, SMALL_STACK, cleanup, etc. 2023-07-14 11:27:59 -05:00
Daniel Pouzzner f6f8d2eda3 add WC_DO_NOTHING macro to wolfssl/wolfcrypt/types.h, with default expansion "do {} while (0)", and globally refactor to use the macro where appropriate, annotating intended-null macros-with-args with "/* null expansion */";
tweak several #includes of settings.h to include types.h instead (all of these are for clarity, as types.h is indirectly included by later #includes), and add #include <wolfssl/wolfcrypt/types.h> where missing;

remove trailing semicolons from PRAGMA*() macro invocations as they are unneeded and can be harmful (inducing frivolous -Wdeclaration-after-statement etc.).
2023-07-14 09:50:01 -05:00
Iyán Méndez Veiga 7c14ea67ae
Rename sphincs algs to follow upstream
This also adds new keys for SPHINCS+. The reason is that SPHINCS+
was updated to 3.1 in liboqs (open-quantum-safe/liboqs/pull/1420),
and old keys are incompatible with the new implementation.

Keys were generated using the oqs-provider for OpenSSL 3

openssl genpkey \
    -provider default -provider oqsprovider \
    -algorithm sphincsshake128fsimple \
    -outform der \
    -out bench_sphincs_fast_level1_key.der

And certs_test.h was updated using xxd

xxd -i -c 10 -u bench_sphincs_fast_level1_key.der

This was repeated for the 6 variants of SPHINCS+ that wolfSSL supports.
2023-07-10 18:31:07 +02:00
jordan 55bbd5865c LMS/HSS: cleanup, and safer write/read callbacks 2023-07-07 15:30:50 -05:00
Juliusz Sosinowicz c4cbf0508b Add zephyr action 2023-07-07 20:18:19 +02:00
jordan 67bef21185 Add LMS/HSS wolfCrypt hooks. 2023-07-06 10:55:53 -05:00
Dimitri Papadopoulos 50752f5a2b
Fix typos found by codespell 2023-07-04 07:21:27 +02:00
Sean Parkinson e2424e6744 SM2/SM3/SM4: Chinese cipher support
Add support for:
 - SM2 elliptic curve and SM2 sign/verify
 - SM3 digest
 - SM4 cipher with modes ECB/CBC/CTR/GCM/CCM

Add APIs for SM3 and SM4.
Add SM2 sign and verify APIs.
Add support for SM3 in wc_Hash and wc_Hmac API.
Add support for SM3 and SM4 through EVP layer.
Add support for SM2-SM3 certificates. Support key ID and name hash being
with SHA-1/256 or SM3.
Add support for TLS 1.3 cipher suites: TLS-SM4-GCM-SM3, TLS-SM4-CCM-SM3
Add support for TLS 1.2 SM cipher suite: ECDHE-ECDSA-SM4-CBC-SM3
Add support for SM3 in wc_PRF_TLS.
Add SM2-SM3 certificates and keys. Generated with GmSSL-3.0.0 and
OpenSSL.
2023-07-04 13:36:28 +10:00
Daniel Pouzzner 214f9f55c4 fixes for bugprone-suspicious-missing-comma, clang-analyzer-core.NullDereference, and readability-redundant-preprocessor. 2023-07-03 11:30:08 -05:00
Sean Parkinson a1939d22b9 wolfBot fixes
Importing an EC point ordinate with one being zero will result in
different errors based on different implementations. Check both known
error codes.

Benchmark usage fixed.
2023-06-30 09:07:46 +10:00
JacobBarthelmeh 78107b0f88
Merge pull request #6540 from dgarske/bench_fix
Fix for benchmark always using 4KB of memory for `gStats`
2023-06-27 16:18:29 -06:00
David Garske b1fe15dc70 Further refactor of the benchmark stats tracking. Always use the allocated list (avoids using a stack pointer for ECC descriptions). 2023-06-27 13:05:04 -07:00
David Garske 51ca7bb8e3 Fix to support using `-print` with `WC_BENCH_TRACK_STATS`. 2023-06-27 10:25:48 -07:00
David Garske 00719182d5 Fix for benchmark always using 4KB of memory for `gStats`, even when not required. Added new `WC_BENCH_TRACK_STATS` to enable feature is needed. Code cleanups for line length and headers. 2023-06-23 14:17:22 -07:00
David Garske a56fe30c2c Fixes and cleanups for Keil MDK examples. Combine duplicate user_settings.h. Use SP math all by default. Disable old/deprecated algorithms. Add CMSIS RTOS timer support for TLS and benchmark. 2023-06-22 16:48:17 -06:00
Daniel Pouzzner fffff657de cleanups: line length, WOLFSSL_SMALL_STACK_STATIC, and SAVE_VECTOR_REGISTERS() failure trap in benchmark.c, proper path to benchmark.c in linuxkm/module_hooks.c, and proper casting in aes.c. also harmonized semantics and prototype of bench_ripemd(). 2023-05-17 13:00:46 -05:00
Daniel Pouzzner 37b716192b wolfcrypt/benchmark/benchmark.c: fix typo in bench_stats_start(). 2023-05-17 02:27:04 -05:00
Daniel Pouzzner 3ad7e39dc4 refactor benchmark.c for linux kernel compatibility -- WOLFSSL_SMALL_STACK and WOLFSSL_NO_FLOAT_FMT codepaths, SAVE/RESTORE_VECTOR_REGISTERS, refactor of several stack array initializations that broke in the kernel, and replacement of an fputs() call with printf(). 2023-05-17 01:04:40 -05:00
David Garske 61dfbf5ef2 Fixes and improvements for building with low footprint. Fix for ASN template with RSA verify only (was missing `mp_leading_bit`). Fix to allow disabling DRBG with crypto callbacks enabled. Updated the wolfTPM user_settings.h template with low resource option. 2023-05-02 16:51:41 -07:00
Juliusz Sosinowicz c9d91c5e79 Zephyr port update
- Add CONFIG_PTHREAD_IPC when using threads
- Add logging config suggestions
- test.c: fix undefined `ret` error
- Increase stack size for samples
- Ignore ASN_BEFORE_DATE_E in examples
- wc_port.h: add missing posix thread includes
- wc_port.h: move definitions to relevant section
- benchmark.c: fix missing `arc` and `argv` errors
- benchmark.c: fflush does not work on stdout in Zephyr
- Update z_fs_open implementation to support flags
2023-04-19 18:18:00 +02:00
gojimmypi 510038022f
Various Espressif HW crypto, SHA2, AES, MP updates. (#6287)
* various Espressif HW crypto, SHA2, AES, MP updates.

* code review updates & cleanup

* clean trailing whitespace

* cleanup per code review

* removed additional unused WOLFSSL_USE_ESP32C3_CRYPT_HASH_HW

* Code review updates; pack & order WC_ESP32SHA

* clean up TAG text for Espressif ESP_LOG()
2023-04-19 06:10:22 -07:00
Daniel Pouzzner 7155c5748e fix overlong lines. 2023-04-12 01:37:09 -05:00
Daniel Pouzzner ed11669f3c more fixes for implicit casts, including asn=template. 2023-04-12 01:37:09 -05:00
Daniel Pouzzner dcc8b5d7d5 eliminate XREWIND() macro, add XSEEK_SET definitions, and refactor all XREWIND()s to XFSEEK()s, to fix clang-tidy-17 bugprone-unsafe-functions warning on rewind();
add BENCH_DEVID_COLUMN_HEADER in wolfcrypt/benchmark/benchmark.c:bench_stats_sym_finish() to resolve clang-diagnostic-embedded-directive.
2023-04-05 20:28:51 -05:00
JacobBarthelmeh 30adcd58d8 IMX6Q CAAM Port 2023-04-03 16:41:08 -06:00
Sean Parkinson 8851065848 cppcheck fixes
Fix checking of negative with unsigned variables.
Check digestSz for 0 in wc_SSH_KDF() so that no possibility of dividing
by zero.
Change XMEMCPY to XMEMSET in renesas_sce_util.c.
Fix test.c to free prvTmp and pubTmp on read error.
Remove unused variables.
XFREE checks for NULL so don't check before call.
Move variable declarations to reduce scope.
2023-04-03 16:59:58 +10:00
David Garske 22a5a5c45e Add introspection for math build and math cleanups:
* Add introspection for math build.
* Raise build error if more than one multi-precision math library used.
* Fix ESP32 to support using any multi-precision math option.
* Refactor math headers to use `wolfmath.h`
* Refactor of the opaque math variable type `MATH_INT_T` used by crypto hardware (QuickAssist, SE050, ESP32 and STM32).
* Cleanups for building with `WOLFCRYPT_ONLY` and `NO_BIG_INT`.
* Stop forcing use of fast math by default for platforms in settings.h. Note: For users that still want to use fast math (tfm.c) they will need to add USE_FAST_MATH to their build settings.

Applies To:
```
WOLFSSL_ESPWROOM32
WOLFSSL_ESPWROOM32SE
MICROCHIP_PIC32
WOLFSSL_PICOTCP_DEMO
WOLFSSL_UTASKER
WOLFSSL_NRF5x
FREERTOS_TCP
WOLFSSL_TIRTOS
EBSNET
FREESCALE_COMMON
FREESCALE_KSDK_BM
WOLFSSL_DEOS
MICRIUM
WOLFSSL_SGX
```
2023-03-30 14:42:55 -07:00
Sean Parkinson 5f2208e71d Benchmark: fix reporting of base10 2023-03-27 16:29:47 +10:00
Daniel Pouzzner b133f6bbf7
20230223-refactor-test-c-error-codes (#6135)
* wolfcrypt/test/test.{c,h}: refactor to capture and encode error retvals using WC_TEST_RET_*() macros (based on line numbers), and print line and return code in err_sys().
* wolfcrypt/test/test.h: cast back to int in WC_TEST_RET_ENC(), to fix MSVC warning.
* configure.ac: add shake128 and shake256 to enable-all and enable-all-crypto;
* wolfcrypt/benchmark/benchmark.c: fix gating for bench_shake128() from !defined(WOLFSSL_NO_SHAKE128) to defined(WOLFSSL_SHAKE128).
* wolfcrypt/test/test.h: add WC_TEST_RET_TAG_* and WC_TEST_RET_DEC_TAG(), and refactor WC_TEST_RET_{ENC,DEC}_*() macros to implement the tag mechanism;
* add render_error_message() with tag-specific rendering of error strings;
* wolfcrypt/test/test.c: smallstack refactor of shake128_test() and shake128_absorb_test();
* wolfcrypt/test/test.c: change gating around mp_test() and related routines from defined(HAVE_VALGRIND) to defined(WOLFSSL_PUBLIC_MP);
* smallstack refactor of mp_test();
* refactor a slew of WC_TEST_RET_ENC_NC associated with XFOPEN/XFREAD to be WC_TEST_RET_ENC_ERRNO, and add error detection for XFREAD (previously silently tolerating zero retvals).
* wolfcrypt/test/test.c: build mp_test() only if WOLFSSL_SP_MATH_ALL or USE_FAST_MATH (in addition to WOLFSSL_PUBLIC_MP), because many general purpose functions such as sp_mulmod() are gated out in SP builds without WOLFSSL_SP_MATH_ALL.
* wolfcrypt/test/test.c: fix array bounds flubs in shake128_test();
* don't print_fiducials() in wolfcrypt_test() header, but rather, after render_error_message() in err_sys().
* wolfcrypt/test/test.{c,h}: wrap some overlong lines, and fix an unused-variable warning in mp_test_set_is_bit().
* wolfcrypt/test/test.c: fixes for several misplaced and several missing WC_TEST_RET_ENC_EC()s.
2023-02-28 13:02:37 -08:00
Tim Weller fd3d8c407d Update wolfCrypt benchmark Windows / Visual Studio build files to include x64 Configuration/Platform combinations (e.g. Debug-x64) and fixed compilation errors in benchmark.c related to conditional-compilation. 2023-02-24 11:53:01 -06:00
gojimmypi 821120e31c
Add SHA512/224 and SHA512/256 benchmarks (#6113) 2023-02-21 09:27:03 -08:00
Sean Parkinson 195ca1a20a AES GCM benchmark: separate aes-gcm streaming runs
Always to AES-GCM one-shot benchmark.
When WOLFSSL_AESGCM_STREAM, always perform AES-GCM streaming benchmark.
2023-02-16 09:37:00 +10:00
David Garske cefd55eb74 Fix for benchmarking shake with custom block size. Using `./benchmark -shake 1024` caused seg fault. 2023-02-08 11:25:53 -08:00
David Garske 48a136a932 Fix for `MB` vs `MiB` printing. The `base2` option was printing type backwards (`base2=1` = 1024 bytes and `base2=0` or `-base10` means 1000 bytes). 2023-01-12 11:09:20 -08:00
David Garske 5e1c7c3db2 Fix for benchmark help broken in PR #5871 2023-01-11 15:05:07 -08:00
Daniel Pouzzner 43265669c6 fix warnings around clang-diagnostic-embedded-directive and readability-uppercase-literal-suffix; update wolfSentry integration for upcoming release 0.8.0. 2023-01-05 00:13:17 -06:00
Jacob Barthelmeh 9dcc48c8f7 update copyright to 2023 2022-12-30 17:12:11 -07:00
Anthony Hu 0787ab1131 don't call external implemenation of kyber from benchmark anymore. 2022-12-29 11:48:54 -05:00
Anthony Hu b3e99348cd Purge the AES variant of Dilithium 2022-12-27 14:37:47 -05:00
Daniel Pouzzner 425d0b72c3 wolfcrypt/benchmark/benchmark.c: fix bench_stats_sym_finish() in GENERATE_MACHINE_PARSEABLE_REPORT mode to properly render "bytes_total" column in bytes, not the unit selected by WOLFSSL_BENCHMARK_FIXED_UNITS_*. 2022-12-26 20:25:05 -06:00
David Garske 60037ead70
Merge pull request #5871 from gojimmypi/BenchmarkEnhancements
Benchmark Enhancements and Code Cleanup
2022-12-22 17:18:47 -08:00
Andras Fekete bc15f67d8d Fixing indentation on preprocessor commands 2022-12-19 11:13:58 -05:00
András Fekete 11fcb790b1
Merge branch 'wolfSSL:master' into ESP-IDF_fixes 2022-12-19 11:11:55 -05:00
gojimmypi 64a7d511b8 Merge branch 'master' of https://github.com/wolfSSL/wolfssl into BenchmarkEnhancements 2022-12-16 14:00:16 -08:00
gojimmypi c370529975 manual merge with upstream 2022-12-16 11:28:04 -08:00
Daniel Pouzzner 04b31518ba wolfcrypt/benchmark/benchmark.c: fix calculation of outer iteration constant in bench_aesecb_internal(); fix .c.h clash in argument name ("useDevId" vs "useDeviceID"). 2022-12-16 12:55:37 -06:00
Andras Fekete 814ad9fc38 Better fixes 2022-12-16 11:55:28 -05:00
Andras Fekete b823da9bb9 Fix build issues with the latest ESP-IDF 2022-12-15 16:11:39 -05:00
gojimmypi d8c9a5aa17 return benchmark to auto-scale units by default 2022-12-14 20:45:44 -08:00
gojimmypi 8831fbd22e fix csv math, units/sec, PQ cycle header 2022-12-14 20:27:15 -08:00
JacobBarthelmeh 8924487f27 fix warning for builds using cmac and not devID 2022-12-14 15:38:08 -08:00
JacobBarthelmeh 9f77210b0b update benchmark for devID builds 2022-12-14 15:20:03 -08:00
Sean Parkinson 819d40a76f Benchmark AES-OFB: initialize and free AES object
Device ID is not initialized unless wc_AesInit() is called.
Call wc_AesFree() for possible hardware implementations.
2022-12-12 10:45:21 +10:00
gojimmypi 5e434e62fb Support for WOLFSSL_BENCHMARK_FIXED_CSV, minor changes per #5871 feedback 2022-12-09 12:39:51 -08:00
gojimmypi 6c3e301006 Benchmark Consolidated Enhancements and Code Cleanup 2022-12-09 10:09:56 -08:00
Anthony Hu 3aa74e3c8c stdout is undeclared 2022-12-08 15:29:48 -05:00
David Garske 9d9549fbd3
Merge pull request #5836 from anhu/kyber_cleanup
Remove kyber-90s and route all kyber through wolfcrypt.
2022-12-05 13:18:44 -08:00
Anthony Hu a2fb4c0788 Remove kyber-90s and route all kyber through wolfcrypt. 2022-11-30 17:17:28 -05:00
Daniel Pouzzner a9b28c1562 wolfcrypt/benchmark/benchmark.c: make iteration increment in bench_aesecb_internal() even lumpier (by a factor of 10) to further reduce false positives from iteration overhead. 2022-11-29 14:39:44 -06:00
David Garske 3046899966
Merge pull request #5821 from anhu/ntru_saber_purge
Purge NTRU and SABER. Not going to be standardized.
2022-11-28 08:28:11 -08:00
Sean Parkinson 7005d416ce SP int: Comment and rework some code
Improvements to sp_int.c that make it slightly quicker and documented.
2022-11-28 18:06:09 +10:00
Anthony Hu 0bfa5c9836 Purge NTRU and SABER. Not going to be standardized. 2022-11-25 14:54:08 -05:00
Daniel Pouzzner ca1ca24bc9 wolfcrypt/benchmark/benchmark.c: fix formatting (column alignment) in asym tests; fix typo in asym_pq section. 2022-11-08 12:31:04 -06:00
Daniel Pouzzner b140abd1fd wolfcrypt/benchmark/benchmark.c: add check_for_excessive_stime() and remove double declaration of base_rusage and cur_rusage. 2022-11-03 13:48:51 -05:00
Daniel Pouzzner 4ab41caf40 make static flags sym_header_printed, asym_header_printed, and pqasym_header_printed, local to the routines that use them (fixes an -Wunused-variable in -UBENCH_ASYM builds). 2022-11-01 01:12:17 -05:00
Daniel Pouzzner 89182b829f wolfcrypt/benchmark/benchmark.c: add GENERATE_MACHINE_PARSEABLE_REPORT and LINUX_RUSAGE_UTIME codepaths;
fflush stdout after each scenario for line-buffered pipelining;

refactor csv_header_count into sym_header_printed, asym_header_printed, and pqasym_header_printed;

move SAKKE tests to precede PQ tests;

rename bench_stats_sym_check() to bench_stats_check();

add bench_stats_asym_finish_ex() accepting a "desc_extra" arg, and use it to disambiguate otherwise-homonymous SAKKE runs;

fix bench_aesecb_internal() to not check time (syscall) for every 3 blocks processed.
2022-11-01 00:15:37 -05:00
Sean Parkinson fd7544ca19 Regresssion testing fixes
Ed25519 and Ed448 need to enable certs.

If no system CA certs can't be parsed,
wolfSSL_CTX_load_system_CA_certs() will fail. Don't try test if RSA and
ECC are not enabled.

Fix benchmark.c so that e is defined when WOLFSSL_BENCHMARK_ALL defined.

MAX_LENGTH_SZ is 4 and supports lengths up to 2^24 - one byte for length
and 3 bytes of length.
(new gcc compiler fix)
2022-10-27 17:47:48 +10:00
Jacob Barthelmeh 65d7d43497 use a check for if defined rather than value of macro 2022-10-24 16:32:19 -06:00
Jacob Barthelmeh eb4c3e06eb revert NO_MAIN_DRIVER behavior in benchmark app 2022-10-24 16:27:23 -06:00
Anthony Tatowicz 1f82e90dbf Add SECP384 and SECP521 to bench 2022-10-21 18:50:59 -05:00
David Garske 0006d1f91c Fix benchmark with small stack and `WOLFSSL_RSA_VERIFY_ONLY`. 2022-10-04 08:39:42 -07:00
David Garske f9506dc05a Add small stack to DoClientHello Suites (360 bytes). Add small stack for DRBG health test. Refactor of the small stack into its own header, to allow easier use in other files. Minor build fixes. 2022-09-30 14:06:31 -07:00
Daniel Pouzzner ddad526e64 wolfcrypt/benchmark/benchmark.c: fix clang-tidy complaints around ungrouped string continuation and unparenthesized macro args. 2022-09-30 12:05:57 -05:00
Steffen Jaeckel f24cf38f01 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 <jaeckel-floss@eyet-services.de>
2022-09-29 09:39:57 -06:00
David Garske 221fd275fd Fixes for building without SHAKE. 2022-09-23 14:50:16 -07:00
David Garske b42631c721 Fix for ESP32 wolfcrypt_test entry point. 2022-09-23 13:58:49 -07:00
Anthony Hu bcf4dbe697 Changes inspired by Feedback from Sean.
Define WOLFSSL_HAVE_KYBER when HAVE_LIBOQS is defined.
Fix some misleading debug output.
Fix benchmarking logic.
2022-09-13 10:07:28 -04:00
Anthony Hu a2635be9e6 wolfCrypt support for external Kyber implementations (liboqs and pqm4) 2022-09-13 10:07:28 -04:00
Sean Parkinson 8c1e2c52e7 Kyber: Add option to build Kyber API
wolfSSL Kyber implementation not included.
Added tests and benchmarking.
2022-09-13 10:07:27 -04:00
David Garske 9c88d8ac2c
Merge pull request #5547 from JacobBarthelmeh/mcux
Port to RT685 with FreeRTOS
2022-09-07 12:54:54 -07:00
Sean Parkinson f153e65102 SHA-3: check BMI1 availablity for ASM
Added benchmarking of SHAKE128 and SHAK256.
2022-09-05 14:11:02 +10:00
Anthony Hu 10ce703d71 Add sphincs to wolfCrypt.
Note that we will not support sphincs in TLS so nothing above wolfcrypt changes.
2022-09-02 11:53:55 -04:00
JacobBarthelmeh b3fa6f654e no realloc, adjustable static test size, fsl RTC 2022-08-26 09:15:33 -06:00
David Garske 60437bba6e
Merge pull request #5378 from anhu/dilithium
Initial commit to add Dilithium NIST PQC winner.
2022-08-12 09:29:42 -07:00
Chris Conlon c66a21c40a
Add Zephyr support for nRF5340 with CryptoCell-312, PSA Crypto fixes (#5418)
* PSA: set AES key bits, define PSA_ALG_NONE/PSA_KEY_ID_NULL if needed
* Zephyr: add TimeNowInMilliseconds() for tls13.c, clock_settime() for test.c, update CMakeLists.txt
* Skip including unistd.h for Zephyr in benchmark.c
* Zephyr: update README, add nRF5340dk support to wolfssl_test sample app
* Zephyr: add wolfCrypt benchmark sample app
* Zephyr: add nRF5340 support to tls_thread sample app
* PSA: use specific hash algo with psa_sign/verify_hash()
* Zephyr: add support for PSA Crypto API with PK callbacks to wolfssl_tls_threaded sample app
* Zephyr: add new files to zephyr/include.am
2022-08-11 17:42:05 -07:00
Anthony Hu 82a900b438 Initial commit to add Dilithium NIST PQC winner.
Also:

* added HAVE_FALCON guards as needed.
* corrected minor falcon bugs as I found them.
* handling OID sum collision between DILITHIUM_LEVEL5 and DILITHIUM_AES_LEVEL3

Tested with the following commands:

examples/server/server -v 4 -l TLS_AES_256_GCM_SHA384 \
    -c ~/tmp/dilithium_aes_level5_entity_cert.pem \
    -k ~/tmp/dilithium_aes_level5_entity_key.pem \
    -A ~/tmp/dilithium_aes_level5_root_cert.pem --pqc P521_KYBER_LEVEL5

examples/client/client -v 4 -l TLS_AES_256_GCM_SHA384 \
    -c ~/tmp/dilithium_aes_level5_entity_cert.pem \
    -k ~/tmp/dilithium_aes_level5_entity_key.pem \
    -A ~/tmp/dilithium_aes_level5_root_cert.pem --pqc P521_KYBER_LEVEL5

with permutations of SHAKE,AES variants and levels 2,3,5
2022-08-11 11:38:31 -04:00
David Garske 53e0483e47 Support for Infineon AURIX IDE. Fixes for Aurix compiler warnings. 2022-08-02 16:53:47 -07:00
Daniel Pouzzner 3ac04fa3ee wolfcrypt/benchmark/benchmark.c: fix gating for #include <unistd.h>. 2022-07-28 09:28:36 -05:00
Jacob Barthelmeh 8eaa85e412 update copyright year to 2022 2022-07-19 10:44:31 -06:00
Daniel Pouzzner b64949d564 wolfcrypt/benchmark/benchmark.c: fix gating for #include <errno.h>, and add #include <unistd.h> for _exit(). 2022-07-11 23:15:43 -05:00
Daniel Pouzzner ccc5952369 global fixup to check or explicitly ignore return values from failable library/system calls that weren't already being checked;
add wolfCrypt error codes IO_FAILED_E "Input/output failure" and SYSLIB_FAILED_E "System/library call failed";

tests/api.c and tests/unit.c: flush stdout for error message in Fail() macro, add fflush(stdout) after printf()s, print success message at end of unit_test(), and send several error messages to stderr instead of stdout;

wolfcrypt/test/test.c: add fallthrough macro definition of printf() that pairs it with fflush(stdout);

unit.h: in definition of macro AssertPtr(), add PRAGMA_GCC("GCC diagnostic ignored \"-Wpedantic\"");

sp_int.c: refactor several lingering instances of "if (0) { ... }" code pattern to #if 0 ... #endif.
2022-07-11 22:28:09 -05:00
Chris Conlon 364bf482eb adjust wolfCrypt test/benchmark Android log TAG name, reset malloc/free counts in memcb_test() 2022-06-13 09:42:02 -06:00
David Garske 5672e2a885 Fixes for buffers when testing with Intel QAT hardware and `fsanitize=address`:
* PKCS7 should use allocated buffer for RSA.
* PKCS7 small stack typo for `keyAlgArray` size in `wc_PKCS7_AddRecipient_KTRI`.
* Fix for use of `free`, which should be `XFREE` in api.c.
* Cleanup old RSA benchmarking MDK5/WINCE code no longer needed with `WC_DECLARE_ARRAY_DYNAMIC_DEC` and `WC_DECLARE_ARRAY_DYNAMIC_EXE`.
2022-06-01 12:07:57 -07:00
Sean Parkinson fab9e29513 benchmark.c: fix Jenkins failure where byte, word32 not defined 2022-05-24 12:10:01 +10:00
Hayden Roche fd535242a0 Fix main signature in benchmark.c.
If `NO_CRYPT_BENCHMARK` is defined, the main function is `int main()`, but it
should be `int main(void)`.
2022-05-17 14:28:43 -07:00
Chris Conlon b76c70d969
Merge pull request #5120 from dgarske/v5.3.0_cubepack 2022-05-08 07:50:20 -06:00
David Garske bc877dab2a Changes to support v5.3.0 cube pack for ST. 2022-05-06 15:49:11 -07:00
Daniel Pouzzner 99b44f15ef fix various -Wdeclaration-after-statement, with and without --enable-smallstack. 2022-05-06 13:34:32 -05:00
Daniel Pouzzner 4e02d7e404 fix clang-tidy-Customer-CFG-7 readability-redundant-preprocessor. 2022-04-26 10:20:26 -05:00
Eric Blankenhorn b543aa0148 Fix for mingw builds 2022-04-22 14:35:46 -05:00
Sean Parkinson 284ebacc57
Merge pull request #4916 from JacobBarthelmeh/hsm
Add SECO use and expand cryptodev
2022-04-07 10:21:32 +10:00
JacobBarthelmeh a338b4c933 refactor SHA grew function, revert benchmark devid, increase SHA_CTX size, add AES ECB cryptocb test 2022-04-05 14:45:18 -07:00
John Safranek 0ee01f08bc
Merge pull request #4984 from douzzer/20220325-multi-test-cleanup
20220325 multi-test fixes
2022-03-25 15:06:34 -07:00
David Garske 07f9ca60ac Fix for async without threading. `./configure --enable-asynccrypt --enable-all CFLAGS="-DWC_NO_ASYNC_THREADING"`. 2022-03-25 12:43:04 -07:00
Sean Parkinson fd66f6bcec SP ASM improvements
Change Karatsuba implementations for x86_64.
Fix ECC code to better handle corner cases.
Add 'lower' versions of functions wehn an input is known to be less than m.
Add mont_add/dbl/tpl/sub for P384.
Change ECC point add to be cache-attack resistant.
Change mod_exp to be cache-attack resistant.
2022-03-25 10:04:25 +10:00
Jacob Barthelmeh 090932b65c FIPS benchmark of cmac and ecb 2022-03-17 12:04:52 -06:00
JacobBarthelmeh 55b42dd85a Add SECO use and expand cryptodev 2022-03-17 12:04:52 -06:00
Anthony Hu fbfb1fee91 Add Post-quantum KEM benchmark for STM32 2022-03-15 14:49:40 -04:00
David Garske 570daa6a7f Enable support for STM32U585 and PQ on M4 2022-03-10 14:19:01 -05:00
David Garske 3fdb6f0a4a Only use pthreads if supported in config. 2022-02-25 13:05:04 -08:00
David Garske e3e1426b91 Improve benchmark threading macros and text output. Thread protections on variables. Fixes for testing with async. 2022-02-25 10:51:19 -08:00
Sean Parkinson 56adf831a3 Benchmark: support multi-threaded testing 2022-02-25 14:12:03 +10:00
Sean Parkinson 2eb044dc60 SP: Add support for P521 2022-02-23 14:51:47 +10:00
David Garske 4f1aa9a475 Fix benchmark input/output arguments. Cleanup line length and whitespace. 2022-02-09 13:13:42 -08:00
Anthony Hu 9ea40f3a9c Purge IDEA cipher 2022-01-31 15:29:25 -05:00
Anthony Hu b957a6e872 Purge Rabbit cipher 2022-01-28 13:13:53 -05:00
Daniel Pouzzner 6a56d3e131 jumbo patch of fixes for clang-tidy gripes (with some bug fixes).
defect/gripe statistics:

    configured --enable-all --enable-sp-math-all --enable-intelasm

    with LLVM 13 clang-tidy -checks=readability-*,bugprone-*,misc-no-recursion,misc-misplaced-const,misc-redundant-expression,misc-unused-parameters,misc-unused-using-decls,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-optin.performance.Padding,-readability-braces-around-statements,-readability-function-size,-readability-function-cognitive-complexity,-bugprone-suspicious-include,-bugprone-easily-swappable-parameters,-readability-isolate-declaration,-readability-magic-numbers,-readability-else-after-return,-bugprone-reserved-identifier,-readability-suspicious-call-argument,-bugprone-suspicious-string-compare,-bugprone-branch-clone,-misc-redundant-expression,-readability-non-const-parameter,-readability-redundant-control-flow,-readability-misleading-indentation,-bugprone-narrowing-conversions,-bugprone-implicit-widening-of-multiplication-result

    [note these figures don't reflect additional defects fixed in this commit for --enable-smallstack, --enable-fips, --enable-async, --enable-asn=template, and --enable-fastmath, and --disable-fastmath]

    pre-patch warning count per file, with suppressions:

    clang-analyzer-security.insecureAPI.strcpy    6  wolfssl/tests/suites.c
    clang-analyzer-security.insecureAPI.strcpy    2  wolfssl/testsuite/testsuite.c
    bugprone-suspicious-missing-comma             3  wolfssl/examples/server/server.c
    bugprone-suspicious-missing-comma             3  wolfssl/examples/client/client.c
    readability-redundant-preprocessor            2  wolfssl/wolfcrypt/src/asn.c
    readability-redundant-preprocessor            1  wolfssl/wolfcrypt/src/rsa.c
    readability-redundant-preprocessor            9  wolfssl/src/ssl.c
    readability-redundant-preprocessor            2  wolfssl/src/tls13.c
    readability-redundant-preprocessor           18  wolfssl/tests/api.c
    readability-redundant-preprocessor            3  wolfssl/src/internal.c
    readability-redundant-preprocessor           10  wolfssl/wolfcrypt/test/test.c
    readability-named-parameter                   1  wolfssl/wolfcrypt/benchmark/benchmark.c
    readability-named-parameter                   7  wolfssl/src/internal.c
    readability-named-parameter                   1  wolfssl/wolfcrypt/src/ecc.c
    readability-named-parameter                   1  wolfssl/testsuite/testsuite.c
    readability-named-parameter                  11  wolfssl/wolfcrypt/src/ge_operations.c
    misc-no-recursion                             3  wolfssl/src/ssl.c
    readability-uppercase-literal-suffix          4  wolfssl/wolfcrypt/src/asn.c
    readability-uppercase-literal-suffix          1  wolfssl/src/ssl.c
    readability-uppercase-literal-suffix         13  wolfssl/wolfcrypt/benchmark/benchmark.c
    bugprone-too-small-loop-variable              1  wolfssl/wolfcrypt/src/rsa.c
    bugprone-too-small-loop-variable              2  wolfssl/wolfcrypt/src/sha3.c
    bugprone-too-small-loop-variable              4  wolfssl/wolfcrypt/src/idea.c
    bugprone-signed-char-misuse                   2  wolfssl/src/ssl.c
    bugprone-signed-char-misuse                   3  wolfssl/wolfcrypt/src/sp_int.c
    bugprone-signed-char-misuse                   3  wolfssl/examples/client/client.c
    bugprone-macro-parentheses                   19  wolfssl/wolfcrypt/src/aes.c
    bugprone-macro-parentheses                  109  wolfssl/wolfcrypt/src/camellia.c
    bugprone-macro-parentheses                    1  wolfssl/src/tls.c
    bugprone-macro-parentheses                    3  wolfssl/wolfcrypt/src/md4.c
    bugprone-macro-parentheses                    2  wolfssl/wolfcrypt/src/asn.c
    bugprone-macro-parentheses                   26  wolfssl/wolfcrypt/src/blake2b.c
    bugprone-macro-parentheses                  257  wolfssl/wolfcrypt/src/sha3.c
    bugprone-macro-parentheses                   15  wolfssl/src/ssl.c
    bugprone-macro-parentheses                    1  wolfssl/wolfcrypt/src/sha.c
    bugprone-macro-parentheses                    8  wolfssl/tests/api.c
    bugprone-macro-parentheses                    4  wolfssl/wolfcrypt/src/sp_int.c
    bugprone-macro-parentheses                    6  wolfssl/wolfcrypt/benchmark/benchmark.c
    bugprone-macro-parentheses                   38  wolfssl/wolfcrypt/src/hc128.c
    bugprone-macro-parentheses                   12  wolfssl/wolfcrypt/src/md5.c
    bugprone-macro-parentheses                   10  wolfssl/wolfcrypt/src/sha256.c
    bugprone-macro-parentheses                    4  wolfssl/wolfcrypt/test/test.c
    bugprone-macro-parentheses                    3  wolfssl/wolfcrypt/src/ecc.c
    bugprone-macro-parentheses                    2  wolfssl/tests/suites.c
    bugprone-macro-parentheses                    4  wolfssl/wolfcrypt/src/cpuid.c
    bugprone-macro-parentheses                   26  wolfssl/wolfcrypt/src/blake2s.c
    bugprone-macro-parentheses                   24  wolfssl/wolfcrypt/src/sha512.c
    bugprone-macro-parentheses                    3  wolfssl/wolfcrypt/src/poly1305.c
    bugprone-macro-parentheses                   24  wolfssl/wolfcrypt/src/ripemd.c
    readability-inconsistent-declaration-parameter-name    1  wolfssl/src/internal.c
    readability-inconsistent-declaration-parameter-name    1  wolfssl/testsuite/testsuite.c

    pre-patch warning count summaries, with suppressions:

    clang-analyzer-security.insecureAPI.strcpy                  8
    bugprone-suspicious-missing-comma                           6
    readability-redundant-preprocessor                         45
    readability-named-parameter                                21
    misc-no-recursion                                           3
    readability-uppercase-literal-suffix                       18
    bugprone-too-small-loop-variable                            7
    bugprone-signed-char-misuse                                 8
    bugprone-macro-parentheses                                601
    readability-inconsistent-declaration-parameter-name         2

    pre-patch warning count summaries, without suppressions:

    clang-analyzer-security.insecureAPI.strcpy                  8
    bugprone-branch-clone                                     152
    readability-non-const-parameter                           118
    bugprone-suspicious-missing-comma                           6
    bugprone-suspicious-include                                52
    readability-magic-numbers                               22423
    readability-redundant-preprocessor                         45
    readability-named-parameter                                21
    readability-function-cognitive-complexity                 845
    readability-else-after-return                             398
    bugprone-implicit-widening-of-multiplication-result       595
    readability-function-size                                  21
    readability-isolate-declaration                          1090
    misc-redundant-expression                                   2
    bugprone-narrowing-conversions                            994
    misc-no-recursion                                           3
    readability-uppercase-literal-suffix                       18
    bugprone-reserved-identifier                               56
    readability-suspicious-call-argument                       74
    bugprone-too-small-loop-variable                            7
    bugprone-easily-swappable-parameters                      437
    bugprone-signed-char-misuse                                 8
    readability-misleading-indentation                         94
    bugprone-macro-parentheses                                601
    readability-inconsistent-declaration-parameter-name         2
    bugprone-suspicious-string-compare                        495
    readability-redundant-control-flow                         20
    readability-braces-around-statements                    11483
    clang-analyzer-valist.Uninitialized                         1
    clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling   3502
2022-01-21 01:25:48 -06:00
David Garske 609d6442b1
Merge pull request #4753 from SparkiDev/siphash
Add SipHash algorithm
2022-01-19 18:51:44 -08:00
Sean Parkinson a6485a228d Add SipHash algorithm 2022-01-20 09:41:18 +10:00
Hayden Roche 62b07d8806 Add AES-SIV (RFC 5297).
This commit adds functions to encrypt and decrypt data using AES in SIV mode, as
described in RFC 5297. This was added in the process of porting chrony to
wolfSSL. chrony is an NTP implementation that can use NTS (network time
security), which requires AES-SIV.
2022-01-19 14:32:33 -08:00
Anthony Hu c2860cb311 Get rid of HC-128 2022-01-17 18:11:54 -05:00
David Garske 84df7a50dc Minor build warning fixes. Possible benchmark unused `bench_pq_asym_algs`. Fix if RSA enabled and `WOLFSSL_SP_MATH` set and `WOLFSSL_HAVE_SP_RSA` is not. 2022-01-04 15:38:35 -08:00
David Garske 9d137668c7
Merge pull request #4675 from julek-wolfssl/openssh-8.8
Fix macro name conflicts with openssh
2021-12-22 08:31:36 -08:00
Juliusz Sosinowicz 8435eb4644 Add `WC_` namespace to variable handling defines 2021-12-22 12:16:02 +01:00
Anthony Hu 7d4c13b9a4 --with-liboqs now defines HAVE_LIBOQS and HAVE_PQC
AKA: The Great Rename of December 2021
2021-12-20 11:48:03 -05:00
David Garske 6d4c067b72
Merge pull request #4607 from anhu/wolfcrypt_pq_benchmarks
Use wolfCrypt's benchmarking app to run the PQ algorithms.
2021-11-30 10:09:48 -08:00
Chris Conlon 7221e06ff7
Merge pull request #4588 from miyazakh/sce_protect_mode_e2studio 2021-11-29 15:32:48 -07:00
Anthony Hu 8a2945fe66 More braces. 2021-11-29 15:56:44 -05:00
Anthony Hu 5aa8bc2983 Drop a brace. 2021-11-29 15:47:53 -05:00
Anthony Hu fea438d07f Use wolfCrypt's benchmarking app to run the PQ algorithms. 2021-11-26 15:15:23 -05:00
Hideki Miyazaki fb4e39f00a
addressed review comments prt1 2021-11-26 16:03:42 +09:00
David Garske f6c48bf7dc
Merge pull request #4560 from kaleb-himes/OE30-OE31-non-fips-changes
OE30 and OE31 changes external to FIPS module for NetBSD builds
2021-11-19 15:49:30 -08:00
Hideki Miyazaki f50fcd918e support Renesas RA SCE protect mode on RA6M4 evaluation board 2021-11-19 14:22:16 +09:00
kaleb-himes 38ec0bb31f Merge branch 'master' of github.com:wolfssl/wolfssl into OE33_NON_FIPS_CHANGES 2021-11-17 14:02:56 -07:00
kaleb-himes f638df3575 Fix issues found by XCODE and add user_settings.h
Disable internal test settings by default
2021-11-17 11:00:56 -07:00
John Safranek ef62fab4ea
Update
1. WIN10 FIPS build should use version 5,2 now.
2. Update the v5-ready build ot use version 5,2.
3. Remove eol-whitespace from the benchmark source.
2021-11-17 09:19:34 -08:00
David Garske 3c1deff611 Fix falcon bench cleanup case (should not free if init fails). Fix RSA key gen keySz with `./wolfcrypt/benchmark/benchmark -asym`. 2021-11-10 15:03:44 -08:00
Anthony Hu 453404a864 Get the falcon keys into wolfssl/certs_test.h 2021-11-10 17:33:24 -05:00
kaleb-himes 6bb86cf4da OE30 and OE31 changes external to FIPS module for NetBSD builds 2021-11-10 15:16:21 -07:00
Anthony Hu 5fe078d7db sig1, sig5 --> sig 2021-11-10 16:52:05 -05:00
Anthony Hu 246d470956 Refactor to do proper memory management. 2021-11-10 16:42:48 -05:00
Anthony Hu 237b098ba5 Add Falcon benchmarking. 2021-11-10 14:53:35 -05:00
Daniel Pouzzner 0b4f34d62a typographic cleanup: fix whitespace, remove unneeded UTF-8, convert C++ comment constructs to C. 2021-11-08 17:35:05 -06:00
Kareem 2f1a37769e Fix doAsync warning in bench_ecc. 2021-11-08 11:42:05 -07:00
Daniel Pouzzner 6ba55edd50 fix async warnings 2021-10-29 14:37:39 -06:00
John Safranek 75df6508e6 Add a read enable for private keys when in FIPS mode. 2021-10-26 20:24:29 -05:00
Daniel Pouzzner f264741aa0 benchmark.c: fix -Wstringop-truncation in _ASYNC_CRYPT bench_stats_add(). 2021-10-26 20:24:27 -05:00
Daniel Pouzzner e3989edd39 wolfcrypt/benchmark/benchmark.c: fix typo. 2021-10-26 20:24:27 -05:00
Daniel Pouzzner cff7c5b3c0 wolfcrypt/benchmark/benchmark.c: in bench_dh(), add a missing #ifdef HAVE_PUBLIC_FFDHE around a DhParams use. 2021-10-26 20:24:26 -05:00
John Safranek f53a4db4e7 Unwind a few changes adding guards so it'll build with old FIPS. 2021-10-26 20:24:26 -05:00
John Safranek 908ec9b14a Modify ffdhe to not return addresses. 2021-10-26 20:24:25 -05:00
John Safranek 976402e04b RNG Update
1. When the seed callback is enabled, allow wc_GenerateSeed() to be used
   as a default callback.
2. Modify all the tests and examples to use the default seed callback if
   the seed callback is enabled.
2021-10-26 20:24:25 -05:00
kaleb-himes 5859779ddf Check-in non-FIPS specific porting changes for OE22
Fix no new line

Change comment style in testsuite.c

Add include for proper socket header in wolfio.h

Add dc_log_printf support to benchmark application

Pull in changes for examples

Refector NETOS check in test.c

Fix format and remove settings used only for validation testing

Implement peer review feedback

Address last items noted in peer review

Add new README to include.am

Adjust comment style on TODO

Gate changes in client and server properly

Add static on customer feedback

Fix settings include

Update latest peer feedback
2021-10-22 15:01:14 -06:00
Anthony Hu 33cb823148
Remove legacy NTRU and OQS (#4418)
* Remove NTRU and OQS

* Keep the DTLS serialization format backwards compatible.

* Remove n from mygetopt_long() call.

* Fix over-zealous deletion.

* Resolve problems found by @SparkiDev
2021-09-24 08:37:53 +10:00
Daniel Pouzzner 45e9872714 wolfcrypt/benchmark: fix output buffer size in bench_eccEncrypt(). 2021-09-20 10:27:13 -05:00
David Garske b6665df6a8
Fixes for sniffer handling of TCP spurious retransmission (#4372)
* Fix for sniffer to better handle spurious retransmission edge case. ZD 12852

* Fix for sniffer to not send alerts during application data processing.

* Fix for missing semi-colon on XFREE.

* Fix for `bench_stats_print` with stack variable name used in `bench_ecc`. Improve benchmark thread cleanup, CPU count calcuation and stat blocking logic.
2021-09-08 09:40:58 +10:00
Sean Parkinson d372f097f7 SP C: change number of words for RSA/DH
Faster small code and fast code.
Allow fixed 4096-bit FFDHE parameters in benchmark.
Convert [u]int[32|64|128]*_t types to sp_[u]int[32|64|128].
Add a div for when top bits are all 1
WOLFSSL_SP_FAST_LARGE_CODE added to make mul_add function faster on
non-embedded platforms.
Change mod_exp window sizes for same performance but less memory.
P256 with c32 now 9 words instead of 10.
2021-07-22 13:12:31 +10:00
Chris Conlon ffd69f6426
Merge pull request #4141 from kaleb-himes/FIPS_ANDROID_v454
Changes to support Android app with wolfCrypt module v4.5.4
2021-07-21 11:23:42 -06:00
John Safranek 77c9b36b5a
Merge pull request #4181 from dgarske/sniffer_keycb
Sniffer fixes and new sniffer key callback support
2021-07-19 13:26:17 -07:00
Daniel Pouzzner 9b43e57ccf ED: add streaming API to the ED verify routines: wc_ed*_verify_msg_init(), wc_ed*_verify_msg_update(), wc_ed*_verify_msg_final();
harmonize the ED448 API with the ED25519 API by making wc_ed448_verify_msg_ex() and wc_ed448_init_ex() public functions;

track devId and heap pointer in ed*_key.{devId,heap}, and pass them through to sha init functions;

add ed*_key.{sha,sha_clean_flag}, and ed*_hash_{reset,update,final} functions, and use them for all ED hashing ops, to support streaming API and for optimally efficient reuse for the preexisting ED calls;

add ed448_hash() akin to ed25519_hash(), and use it in place of wc_Shake256Hash(), for .sha_clean_flag dynamics.

add to wc_ed*_import_private_key() the ability to import the combined key generated by wc_ed*_export_private() without supplying the redundant public key;

add macro asserts near top of ed*.h to assure the required hash functions are available;

fix {NO,HAVE}_ED*_{SIGN,VERIFY};

wolfcrypt/test/test.c: add missing key initializations in ed*_test();

wolfcrypt/test/test.c: fix unaligned access in myDecryptionFunc() detected by -fsanitize=address,undefined.
2021-07-16 13:49:47 -05:00
kaleb-himes f408eeb5bb Implement peer review suggestions 2021-07-16 09:57:11 -06:00
David Garske db32570ab3 Fix for missing `sp_radix_size` with `WC_MP_TO_RADIX`. 2021-07-12 13:40:55 -07:00
Sean Parkinson 34528eb6c9 ECC bench: can't use SAKKE curve with ECDH/ECDSA
Skip curve benchmarking when all curves are being benchmarked.
2021-07-06 12:19:50 +10:00
Elms 56d879f422 address scan-build issues for clang 6 and 10 2021-06-30 21:58:30 -07:00
Sean Parkinson 8592053856 Regression test fixes
./configure --enable-all --disable-rsa
./configure --disable-chacha --disable-asm
./configure --disable-rsa --disable-ecc --disable-dh --enable-curve25519
--enable-cryptonly (and ed25519, curve448, ed448)
./configure --disable-tls13 --enable-psk --disable-rsa --disable-ecc
--disable-dh C_EXTRA_FLAGS=-DWOLFSSL_STATIC_PSK
./configure --disable-oldtls --enable-psk -disable-rsa --disable-dh
-disable-ecc --disable-asn C_EXTRA_FLAGS=-DWOLFSSL_STATIC_PSK
--enable-lowresource --enable-singlethreaded --disable-asm
--disable-errorstrings --disable-pkcs12 --disable-sha3 --disable-sha224
--disable-sha384 --disable-sha512 --disable-sha --disable-md5
-disable-aescbc --disable-chacha --disable-poly1305 --disable-coding
Various build combinations with WOLFSSL_SP_MATH and WOLFSSL_SP_MATH_ALL
2021-06-25 09:18:06 +10:00
kaleb-himes b29fa9bd33 Changes to support Android app with wolfCrypt module v4.5.4 2021-06-17 08:11:40 -06:00
Daniele Lacamera 6d1981abd1 Do not directly include psoc6 port header to prevent loops 2021-06-08 08:24:43 +02:00
Elms 57f4adf438 DEOS: updated memory and add DTLS
Tested: DDC-I 9.2.0r94156 and OpenArbor on PPC hardware
2021-04-16 15:39:19 -07:00
Jacob Barthelmeh 9a86f133c8 additional fixes for reports with test cases 2021-04-05 21:26:52 +07:00
toddouska 1643bec05f
Merge pull request #3862 from kaleb-himes/WIN32_WCE_PORTING
_WIN32_WCE port of wolfCrypt - OE12
2021-03-23 14:40:48 -07:00
kaleb-himes b3eb2e3ddd Implement peer review feedback
Fix items that were missed from peer review

Remove dead code

Add ret capture of return from XVSNPRINTF
2021-03-22 11:55:16 -06:00
Sean Parkinson 35659be06f AES GCM: implement streaming
Updated EVP layer to use streaming API when enabled.
Assembly for x64 updated to include streaming.
2021-03-16 16:39:49 +10:00
toddouska 3ac03d3d66
Merge pull request #3805 from JacobBarthelmeh/copyright
update copyright date to 2021
2021-03-15 16:16:50 -07:00
toddouska 5fd0950a3a
Merge pull request #3654 from SparkiDev/sakke_eccsi
ECCSI and SAKKE: add support
2021-03-15 16:15:59 -07:00
David Garske 2e247cc176
Merge pull request #3870 from JacobBarthelmeh/Benchmark
fix for using devId with benchmarking ECC
2021-03-15 10:09:23 -07:00
JacobBarthelmeh e9b39c3091 fix for using devId with benchmarking ECC 2021-03-12 21:14:20 +07:00
Sean Parkinson a55e94cf6f ECCSI and SAKKE: add support
Fixes for static code analysis included.
Added const to function parameters.
Zeroise some temporaries.
2021-03-12 09:31:22 +10:00
Jacob Barthelmeh c729318ddd update copyright date 2021-03-11 13:42:46 +07:00
kaleb-himes 16d55b0b86 _WIN32_WCE port of wolfCrypt - OE12
Add user_settings.h for OE12

Restrict LPCWSTR typecast to be WINCE specific
2021-03-10 17:02:21 -07:00
toddouska 72eebd6e75
Merge pull request #3795 from JacobBarthelmeh/CAAM
Addition of QNX CAAM driver
2021-03-10 15:04:21 -08:00
Jacob Barthelmeh 79ec07f5e1 adjustment after rebase 2021-03-03 18:45:40 +07:00
Jacob Barthelmeh 69a0b643be removing some magic numbers 2021-03-03 18:45:40 +07:00
David Garske 9ebdc8d61c Additional fixes for building without RNG. Fix for possible use of `key->dp == NULL` in `wc_ecc_export_ex`. 2021-02-24 13:21:54 -08:00
David Garske 10be54054e Minor fixes for build errors and bad macro names. 2021-02-18 10:55:47 -08:00
David Garske c62b48f7d0 Fixes for building with RSA public or verify only. Fixes issue with reserved "div" keyword as variable name. ZD11585 2021-02-18 07:47:00 -08:00
Sean Parkinson 763f388471 SP int: get rsavfy and rsapub working again 2021-02-09 09:58:23 +10:00
toddouska f91dcb950c
Merge pull request #3670 from dgarske/keil
Fix for ARM Keil MDK compiler issue with `DECLARE_VAR_INIT`.
2021-01-25 14:57:05 -08:00
David Garske 05e1ee1694 Cleanup to use fixed sizes from defines for `DECLARE_VAR`. Resolves issue with Visual Studio and using a variable (even const) to declare an array size. 2021-01-25 09:14:12 -08:00
toddouska 920c443864
Merge pull request #3250 from JacobBarthelmeh/Benchmark
add brainpool benchmark
2021-01-22 10:08:21 -08:00
Jacob Barthelmeh 6fa1556daf guard -ecc-all with HAVE_SELFTEST macro 2021-01-22 16:13:31 +07:00
David Garske 1ee40ad7bd Fix to always init the variable (not just when from heap). Cleanup of the `DECLARE_` uses to make sure all allocations succeeded. 2021-01-21 17:12:29 -08:00
toddouska 5837d5e8de
Merge pull request #3649 from dgarske/stm_aesgcm_perf
STM32 AES GCM crypto hardware performance improvements
2021-01-21 15:55:58 -08:00
Jacob Barthelmeh b418936f72 account for FIPS and g++ builds 2021-01-22 04:21:23 +07:00