244 Commits

Author SHA1 Message Date
ZackLabPC
9881edfabe Crypto Callback Support for ARM ASM: AES-ECB/CBC, SHA-1/256/384/512 + Fix SP SHA CB Bug 2024-09-20 09:42:53 -06:00
night1rider
d714e55a2b Addressing PR comments typos and cleanup and support HAVE_AES_ECB, Sha1, and Sha224 2024-09-20 09:42:52 -06:00
msi-debian
2e8cf39feb Initial PR for MAX32665 and MAX32666 TPU HW Support 2024-09-20 09:42:52 -06:00
Sean Parkinson
88c3e0af22 Memory usage improvements
kdf.c: wc_PRF() - No need for previous, reuse current.
sha256.c: Transform_Sha256() - Add slow but small version for many
register implementation.
sp_int.h: Change 'used' and 'size' fields to 16-bit types when possible.
sp_int.c: Fixes for 16-bit used.
2024-09-04 22:51:31 +10:00
Daniel Pouzzner
7a29b1e4fd add comments explaining dependence on idempotency for race-free dynamics re checkedAESNI, haveAESNI, intel_flags, and sha_method. see #7863. 2024-08-14 15:23:48 -05:00
Sean Parkinson
f1e01e4636 RISC-V 64: Add assembly code for SHA-256
Move common defines out of AES file to header file.
2024-07-30 12:21:13 +10:00
David Garske
42403a526e Fix to resolve STM32 hash FIFO. Simplify logic for ensuring FIFO gets filled before doing a save/restore. ZD 18294 2024-07-24 16:06:04 -07:00
JacobBarthelmeh
31a6a2bf59 update copyright to 2024 2024-07-19 13:15:05 -06:00
Daniel Pouzzner
b3e8f0ad24 add --enable-debug-trace-errcodes, WOLFSSL_DEBUG_TRACE_ERROR_CODES, WC_ERR_TRACE(), WC_NO_ERR_TRACE(), support/gen-debug-trace-error-codes.sh. also add numerous deployments of WC_NO_ERR_TRACE() to inhibit frivolous/misleading errcode traces when -DWOLFSSL_DEBUG_TRACE_ERROR_CODES. 2024-06-08 16:39:53 -05:00
Daniel Pouzzner
110f4ec737 wolfcrypt/src/sha256.c: in WC_NO_INTERNAL_FUNCTION_POINTERS code path (linuxkm), fix oversight whereby Transform_Sha256_AVX1_Sha() was used on targets with false IS_INTEL_SHA(intel_flags). the former SHA256_AVX1 method id is now split into SHA256_AVX1_SHA and SHA256_AVX1_NOSHA, with corresponding fixes in Sha256_SetTransform(), inline_XTRANSFORM() and inline_XTRANSFORM_LEN(). 2024-05-22 15:39:46 -05:00
Daniel Pouzzner
af928faca7 Merge pull request #7489 from anhu/zero_len_hash
Allow for zero length hash.  Its not an error.
2024-05-09 01:34:24 -04:00
Anthony Hu
529b6a1eb9 Allow for zero length hash. Its not an error.
Fixes ZD17910
2024-04-30 11:06:30 -04:00
Daniel Pouzzner
bb4c2cbad6 address peer review: typography in linuxkm/linuxkm_memory.c, typography, clarity, and efficiency in wolfcrypt/src/sha256.c and wolfcrypt/src/sha512.c. 2024-04-29 14:02:44 -05:00
Daniel Pouzzner
885497ba5a add missing gate around Sha256_SetTransform() declaration in wolfcrypt/src/sha256.c;
remove stray definitions of XTRANSFORM*() in wolfcrypt/src/sha512.c;

restore global intel_flags in the !WC_NO_INTERNAL_FUNCTION_POINTERS paths of sha256.c and sha512.c;

disable test_wolfSSL_dtls_compare_stateless() in tests/api.c when DEBUG_VECTOR_REGISTER_ACCESS_FUZZING (it depends on a stable SHA512 hash of the in-memory struct WOLFSSL image).
2024-04-27 12:35:23 -05:00
Daniel Pouzzner
65649b63d1 implement WC_C_DYNAMIC_FALLBACK for SHA256. 2024-04-27 12:35:23 -05:00
Daniel Pouzzner
5d9154e8c6 wolfcrypt/src/sha{256,512,3}.c add SAVE_VECTOR_REGISTERS() for SHA-2 and SHA-3 vectorized implementations, and add WC_NO_INTERNAL_FUNCTION_POINTERS code paths to fix GOT relocations around implementation function pointers. 2024-04-23 01:31:43 -05:00
kaleb-himes
e45867bbc3 WIN fips section refactor / wolfEntropy API syntax adjustment 2024-04-09 09:48:33 -06:00
kaleb_himes
81f5ac7f6c SRTP-KDF FS Preview 2024-04-09 09:48:33 -06:00
David Garske
d7c6d7af44 Fix the NXP MMCAU HW acceleration for SHA2-256. Broken with LMS SHA2 refactor. 2024-04-02 19:32:41 -07:00
JacobBarthelmeh
ab8f5f71a0 revert null check in wc_Sha256Update 2024-03-16 02:03:07 +07:00
Daniel Pouzzner
3fd6af0cd2 Merge pull request #7283 from SparkiDev/lms
LMS: initial implementation
2024-03-14 01:48:57 -04:00
Sean Parkinson
6c8df33191 LMS: initial implementation
Initial wolfSSL implementation of LMS.
Changed LMS benchmarking to time making a key and reloading.
SHA-256:
  Added wc_Sha256HashBlock to make hashing a block fast.
Fixed assembly code to be able to hash a block from an external
buffer.
  Simplified code were possible.
Moved byte reversal decision logic to one place instead of replicating
length checks.
2024-03-07 11:43:16 +10:00
gojimmypi
68fb183fa6 Update TLS client example for Espressif ESP8266 2024-02-13 03:01:40 -08:00
jordan
d111d7da1b Fix MD5 and SHA buffer overrun. 2024-02-02 19:50:22 -06:00
Sean Parkinson
492490f7e6 SHA-256: Implementation using Intel instructions
Detects Intel SHA-256 instructions available for CPU.
Preferences implementation using Intel instructions.
2024-01-30 23:17:05 +10:00
gojimmypi
ac6181d7ae Improved Espressif SHA HW/SW selection 2024-01-25 15:23:58 -08:00
Daniel Pouzzner
8a32e7f3f9 fixes for clang -Wunreachable-code-aggressive:
tests/suites.c: in SuiteTest(), swap order of (void)s and return.

wolfcrypt/src/chacha.c: gate out unreachable C wc_Chacha_encrypt_bytes() call in wc_Chacha_Process, and gate out unused implementations of wc_Chacha_wordtobyte() and wc_Chacha_encrypt_bytes(), when defined(USE_INTEL_CHACHA_SPEEDUP).

wolfcrypt/src/sha256.c and wolfcrypt/src/sha512.c: fix logic in Sha256_SetTransform() and Sha512_SetTransform() to make the AVX1_RORX implementations accessible.  also add a missing Transform_Sha512_Len_p = NULL in the C path of Sha512_SetTransform().

wolfssl/internal.h: for the fallback definition of wolfSSL_curve_is_disabled, use an inline function instead of a compound-clause macro, because clang isn't smart enough to treat the compound expression as a bare constant zero, producing a lame-positive -Wunreachable-code.
2023-12-25 00:23:37 -06:00
gojimmypi
07a5566c52 Add wolfcrypt SHA support for ESP32-C2, other minor updates 2023-12-18 17:35:43 -08:00
gojimmypi
9227020f8e code review updates for ESP32 C3/C6/S2 HW Acceleration 2023-11-21 16:22:49 -08:00
gojimmypi
7e69030df1 Espressif ESP32-C3 ESP32-C6 ESP32-S2 Hardware Acceleration 2023-11-20 18:05:18 -08:00
Hideki Miyazaki
e092c57675 change sha h/w acceleration implementation 2023-09-29 16:22:16 +09:00
Chris Conlon
5bc5b8a99b Merge pull request #6768 from miyazakh/renesas_rz
Renesas RZN2L support
2023-09-19 14:38:03 -06:00
gojimmypi
9398fa0736 Espressif HW Improvements (#6624)
* Espressif HW Improvements
* revised AES HW/SW fallback logic for ESP32
2023-09-19 08:21:13 -07:00
Hideki Miyazaki
1c9afb8b12 initial commit for RZN2L board Support 2023-09-13 09:22:55 +09:00
Daniel Pouzzner
344e1661e1 wolfcrypt/src/{hmac.c,sha256.c,sha512.c,kdf.c}: ForceZero() smallstack buffers before freeing them, and ForceZero() the Hmac, wc_Sha512, wc_Sha384, wc_Sha256, and wc_Sha224 structures at the end of their respective freeing routines. also, remove superseded ForceZero() calls in wc_HKDF_Expand(), wc_SSH_KDF(), and wc_HKDF_Extract(). 2023-09-06 14:53:19 -05: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
Hideki Miyazaki
47caa9b06d generalize sce protect impl to fsp sm(secure module) 2023-08-13 09:23:03 +09:00
JacobBarthelmeh
7f0cfcb27d Merge pull request #6667 from bandi13/byebyeCyaSSL
Byebye cya ssl
2023-08-03 15:43:01 -06:00
Andras Fekete
b31e485dc9 Remove 'HAVE_FIPS_VERSION < 2' blocks 2023-08-02 17:08:03 -04:00
Hideki Miyazaki
02ec92a3b9 Support TSIP crypt only
- Aes, sha,
  - rsa
     MakeRsaKey, sign/verify

fix compile error when not enabled TSIP
2023-07-27 06:23:34 +09:00
David Garske
8f36f78e6c Merge pull request #6400 from bandi13/ARIA-cipher
Aria cipher
2023-07-11 09:50:42 -07:00
gojimmypi
57546405c0 refactor WROOM32 ESP32 2023-07-07 15:47:00 -07:00
Andras Fekete
266307da6c Add in ARIA wrappers
Address PR comments + other cleanup


Addressing PR comments


Minor change


Make sure the last line gets output as well


Add in ARIA SHA256 session to internal structure


Add in ARIA SHA384 session to internal structure


Add necessary function for ARIA to extract key


Fix unit tests


Rename HAVE_ARIAGCM to HAVE_ARIA


Move aria.* to wolfcrypt/port/aria


Separate out aria-crypt init functions


Adding in ECC+SHA callbacks


Avoid using AC_CHECK_FILE


Rename Aria to wc_Aria


Don't need special cases


Addressing PR comments


Code cleanup


C89 support


Remove TODO


Add documentation about buffer size


Clean up header files


Use ARIA_DEVID by default if available


Dummy update call to make MagicCrypto happy


Fix for detecting what algo type to use


Documentation


Use the appropriate sign/verify


Collect MagicCrypto functions together (and avoid leaks)


Fall back on other implementations on failure


Fix issue when compiling without CRYPTOCB


Addressing PR comments


Better cleanup


Addressing PR comments


Cleaner exit in case of error
2023-07-06 16:09:23 -04:00
David Garske
fc153ff273 Support for Silicon Labs Gecko SDK v4. Changes SE Hash to use multipart API's. Gecko SDK v3 auto-detected or manually forced using WOLFSSL_SILABS_SE_ACCEL_3. 2023-06-23 14:22:44 -07:00
Chris Conlon
a474179cdf Merge pull request #6301 from miyazakh/ra_cryptonly
Add Renesas SCE RSA Crypt Only support
2023-05-12 16:32:15 -06:00
JacobBarthelmeh
bab35c4de2 add WOLF_CRYPTO_CB_FIND macro to guard find device ID callback 2023-05-10 15:28:19 -07:00
JacobBarthelmeh
71cbc019d7 always call crypto cb when compiled in 2023-05-08 09:49:50 -07:00
Sean Parkinson
1a8f09d013 Merge pull request #6320 from JacobBarthelmeh/curl
smaller sized build with curl
2023-05-03 07:46:29 +10:00
Hideki Miyazaki
4fd629d4e7 fix white spaces and overlong lines 2023-04-20 16:07:51 +09:00
JacobBarthelmeh
dc8f348bdf smaller sized build with curl 2023-04-19 15:12:15 -07:00