Commit Graph

596 Commits

Author SHA1 Message Date
Lealem Amedie
2cde843093 Measure max & min durations within the confines of MAX_SAMPLE_RUNS 2023-11-08 10:45:51 -07:00
Lealem Amedie
1303c0512c Extract some code blocks into macros 2023-11-08 10:45:51 -07:00
Lealem Amedie
46a5465c3f Remove redundant macro 2023-11-08 10:45:51 -07:00
Lealem Amedie
16ecc9b5f8 Address feedback and don't print avg ms if mean is displayed 2023-11-08 10:45:51 -07:00
Lealem Amedie
86a2b050fe Gate on NO_FILESYSTEM 2023-11-08 10:45:50 -07:00
Lealem Amedie
a40de50be2 Add ADVANCED_STATS in benchmark.c 2023-11-08 10:45:50 -07:00
Lealem Amedie
9006dd5edd Document new macro 2023-11-08 10:45:50 -07:00
Lealem Amedie
2ea0c2cae8 Run benchmarks at microsecond level 2023-11-08 10:45:50 -07:00
JacobBarthelmeh
8921a720a1 Merge pull request #6888 from SparkiDev/srtp_kdf
SRTP/SRTCP KDF: add implementation
2023-11-07 10:11:43 -07:00
Sean Parkinson
8c3e1dbf48 SRTP/SRTCP KDF: add implementation
Add implementation of SRTP KDF and SRTCP KDF.
One shot APIs compatible with SP 800-135 and ACVP testing.
Tests added to test.c.
Benchmarking added.
Doxygen added.
2023-11-07 10:33:14 +10:00
Andras Fekete
42c241dbbf Avoid use of uninitialized array 2023-10-27 15:38:46 -04:00
jordan
46b1a030a7 XMSS/XMSSMT hooks support: fix g++ warnings, and small cleanup for review. 2023-10-13 18:01:07 -05:00
jordan
60fea5ee5c XMSS/XMSSMT hooks support: small update for requested changes. 2023-10-11 21:29:45 -05:00
jordan
33d4b331fb Add XMSS/XMSSMT wolfCrypt hooks. 2023-10-05 09:18:50 -05:00
Chris Conlon
5bc5b8a99b Merge pull request #6768 from miyazakh/renesas_rz
Renesas RZN2L support
2023-09-19 14:38:03 -06:00
Hideki Miyazaki
5e97b9fde8 addressed review comments 2023-09-15 13:22:35 +09:00
JacobBarthelmeh
624cb5e2bb Merge pull request #6744 from res0nance/windows-benchmark-config
windows: fix x64 benchmark release builds
2023-09-13 15:52:27 -06:00
Hideki Miyazaki
1c9afb8b12 initial commit for RZN2L board Support 2023-09-13 09:22:55 +09:00
jordan
b36c312ef3 LMS verify-only support: fix clang warning, rename define. 2023-08-31 21:46:00 -05:00
res0nance
3dec8279a0 windows: fix x64 benchmark release builds
The linker should use the x64 option for 64-bit builds
2023-08-31 20:02:37 +08:00
jordan
8662312ecf LMS verify only support. 2023-08-29 15:46:18 -05:00
David Garske
88ad5ce6b0 Merge pull request #6607 from SparkiDev/curve25519_thumb2
Thumb2 ASM, Curve25519
2023-08-24 08:29:54 -07:00
Sean Parkinson
36b92a4cef Thumb2 ASM, Curve25519
Add support for compiling ASM for Thumb2
Add Curve25519 ASM for Thumb2
Limit assembly code compiled when Ed25519 not required.
Rework all assembly implementations to replace ge_*() functions instead
of having fe_ge_*() versions that take many parameters.
Get ARM32 inline asm working.
2023-08-24 17:43:03 +10:00
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