Commit Graph

6925 Commits (f6cb13b11bcfde5d3af6f7433c20fdb0f726d916)

Author SHA1 Message Date
David Garske f6cb13b11b
Merge pull request #5851 from SparkiDev/sp_enable_asm_fix
SP: --enable-sp-asm now enables SP if not set
2022-12-06 17:37:15 -08:00
Sean Parkinson 1de30c6b67 SP: --enable-sp-asm now enables SP if not set
Enabling SP with ASM didn't enable SP or error out when SP wasn't
configured. Now enables SP when '' and errors when 'no'.

SAKKE modinv used large amounts of stack. Change to have more temporary
memory allocated increased to cover the usage.
ECC, SAKKE: sp_<bits>_ecc_mulmod_<cpu><words>() used large amounts of
stack. Allocate when WOLFSSL_SMALL_STACK.

wc_DhCheckKeyPair() not available when HAVE_SELFTEST.
Wasn't compiled in before as WOLFSSL_HAVE_SP_DH wasn't defined.
2022-12-07 09:01:53 +10:00
Anthony Hu 754440e0f2 whitespace 2022-12-06 15:12:44 -05:00
David Garske 44a1ffa56e
Merge pull request #5855 from ejohnstown/rdrand-ok
DRBG OK
2022-12-06 08:53:07 -08:00
David Garske a5f9e5c3c8
Merge pull request #5820 from SparkiDev/entropy_memuse
MemUse Entropy: enabled with HAVE_ENTROPY_MEMUSE
2022-12-06 08:52:45 -08:00
Sean Parkinson 1f6a9d442b MemUse Entropy: enabled with HAVE_ENTROPY_MEMUSE
--enable-entropy-memuse enables the software base entropy gatherer.

The entropy source uses difference in timing to read/write cache lines.
Random indeces into a buffer are updated with the high resolution timer
value which is fed into a hash to produce further random indeces.

The current time is added to the entropy samples at time of
conditioning.
2022-12-06 14:01:16 +10:00
John Safranek 3891cd65d8
DRBG OK
When initializing the RNG and are using RDRAND, or one of the other
replacement random number generators that could fall back to the
Hash_DRBG if unavailable, set the status to DRBG_OK. This would fix a
problem if someone assumes the DRBG status is meaningful.
2022-12-05 16:09:45 -08:00
Sean Parkinson 6db2ea0672 SP int: fix when ECC specific size code included
Was enabled when !SP and HAVE_ECC
Now enabled when !WOLFSSL_SP_MATH and HAVE_ECC
2022-12-06 09:44:05 +10:00
Sean Parkinson f38c7303eb
Merge pull request #5853 from douzzer/20221205-sp-int-bugprone-macro-parentheses
20221205-sp-int-bugprone-macro-parentheses
2022-12-06 09:18:40 +10:00
Daniel Pouzzner 595f8a30d6 wolfcrypt/src/sp_int.c: fix bugprone-macro-parentheses in ALLOC_SP_INT() and ALLOC_SP_INT_ARRAY() introduced in aeca8cb17a. 2022-12-05 15:21:17 -06: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
David Garske d3441545ef
Merge pull request #5852 from SparkiDev/sp_c_perf_2
SP C, SP int: improve performance
2022-12-05 11:51:28 -08:00
David Garske 5dee15d074
Merge pull request #5850 from SparkiDev/sp_exptmod_nct_err_fix
SP int: fix check of err in _sp_exptmod_nct
2022-12-05 11:24:12 -08:00
David Garske 304f287a7e
Merge pull request #5828 from SparkiDev/sp_int_static_size
SP int: check size required when using sp_int on stack
2022-12-05 11:23:25 -08:00
Sean Parkinson 22141faf16 SP C, SP int: improve performance
In SP C: Improve performance of large digit mul and sqr.
In SP int: include optimized 16 digit mul and sqr when compiling SAKKE.
2022-12-05 14:17:09 +10:00
Sean Parkinson 4601a57ff2 SP int: fix check of err in _sp_exptmod_nct 2022-12-05 09:36:28 +10:00
Daniel Pouzzner cd1a61288b wolfcrypt/src/sp_int.c: in _sp_mont_red(), add missing const in SP_WORD_SIZE == 32 codepath. 2022-12-03 10:14:15 -06:00
Sean Parkinson 3239ff5b0e SP int: fixes for static analyser clang-tidy
Const poison sp_int.c to allow static analysers to work better.
sp_prime_is_prime_ex() checks whether a->used is negative to avoid bad
behavior.
2022-12-02 13:57:32 +10:00
David Garske c079455d3e
Merge pull request #5839 from SparkiDev/sp_int_pub_apis
SP int: fix which APIs are public available wiht WOLFSSL_SP_MATH
2022-12-01 19:33:11 -08:00
Sean Parkinson 39716737c1 SP int: fix which APIs are public available wiht WOLFSSL_SP_MATH
Make sp_rshd not available when WOLFSSL_SP_MATH in header.
sp_rshd is not required by any wolfCrypt code.
Fix sp_rshd comment on #endif
Make sp_div publicly available in some WOLFSSL_SP_MATH builds.
Delare sp_div for some WOLFSSL_SP_MATH builds.
Fix test.c to compile with WOLFSL_SP_MATH and HAVE_VALGRIND.
2022-12-02 09:11:35 +10:00
David Garske 5f410b47b7
Merge pull request #5829 from SparkiDev/sp_invmod_fixes
SP int: fix error checks when modulus even
2022-12-01 15:05:22 -08:00
Daniel Pouzzner 1c7826b199 wolfcrypt/src/port/kcapi/kcapi_aes.c: fix error checking on KCAPI wc_AesGcmEncrypt() and wc_AesGcmDecrypt(). 2022-12-01 12:54:57 -06:00
Stefan Eissing e5cfd96609 QUIC API support in OpenSSL compat layer, as needed by HAProxy integration.
- adding patch for HAProxy, see dod/QUIC.md, based on current master.
      For documentaton purposes, since HAProxy does not accept PRs. To be
      removed once forwarded to the project.
2022-12-01 10:12:35 +01:00
Sean Parkinson aeca8cb17a SP int: check size required when using sp_int on stack
SP int can be configured to declare temporary sp_ints.
Check that the requested number of digits is not larger than the max
supported (SP_INT_DIGITS).
Also check arrays of sp_ints too.
2022-12-01 12:53:52 +10:00
David Garske c6a7afee74
Merge pull request #5834 from anhu/http
Correction to a webpage link.
2022-11-30 15:14:35 -08:00
Anthony Hu a2fb4c0788 Remove kyber-90s and route all kyber through wolfcrypt. 2022-11-30 17:17:28 -05:00
Anthony Hu 3b00c9abee Correction to a webpage link. 2022-11-30 16:27:50 -05:00
gojimmypi fec7469c19
Tidy up Espressif ESP32 test and benchmark examples (#5800)
Tidy up Espressif ESP32 test and benchmark examples:
* add VisualGDB project and solution files for server and client
* "hardware in use revert to software" is now verbose level message
* Remove (void) TAG;  - not needed to appease compiler
* include esp_log.h lib with defined(WOLFSSL_ESPIDF)
* large ESP32 default stack size
* check for max number of arguments assembled into array
* cleanup & comments per code review
* wolfssl_test VisualGDB updates
* Espressif wolfssl_test default stack 55,000 bytes
2022-11-30 10:01:46 -08:00
Sean Parkinson c7c80be15e SP int: sp_invmod_div check div result before proceeding 2022-11-30 18:33:35 +10:00
Sean Parkinson faf848a915 SP int: fix error checks when modulus even 2022-11-30 18:15:30 +10:00
Sean Parkinson 61c2fd9a2b SP int: don't call sp_clear unless no longer using sp_int
Put in casts to be sure no compiler complains.
Tidy up other parts of the code.
2022-11-30 16:36:48 +10:00
David Garske 24cc8e7145
Merge pull request #5827 from douzzer/20221129-ecb-benchmark-throughput
20221129-ecb-benchmark-throughput
2022-11-29 18:12:23 -08:00
David Garske 63051f3826
Merge pull request #5825 from SparkiDev/api_test_sep
Unit test: rework to be able to run API tests individually
2022-11-29 18:11:57 -08:00
David Garske b2f9838af4 Fix DSA public decode to allow extra buffer (in case private key is passed in). Fixes for clang-tidy "value stored never read". Allow showing line number and conditional with `DEBUG_WOLFSSL_VERBOSE` on `TEST_RES_CHECK`. 2022-11-29 14:58:52 -08:00
kaleb-himes 4d2b893fb3 Initialize variable causing failures with gcc-11 and gcc-12 2022-11-29 14:59:53 -07: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 7aa796bdbd
Merge pull request #5824 from SparkiDev/pkcs11_init_rv
PKCS#11: add initialization API that returns PKCS#11 return value
2022-11-28 14:31:03 -08: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
David Garske 7697337703
Merge pull request #5816 from SparkiDev/sp_int_rework
SP int: Comment and rework some code
2022-11-28 08:26:58 -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
Sean Parkinson 2d424f7d06 PKCS#11: add initialization API that returns PKCS#11 return value 2022-11-28 16:40:29 +10:00
Sean Parkinson 847c478c45 ARM32 ASM: don't use ldrd on user data
Alignment fixes.
Regeneration of ARM32 has config.h included.
2022-11-28 12:59:58 +10:00
Anthony Hu 0bfa5c9836 Purge NTRU and SABER. Not going to be standardized. 2022-11-25 14:54:08 -05:00
Daniel Pouzzner 466b625b5d wolfcrypt/src/logging.c: add missing void arg list to definition of wc_GetCurrentIdx(). 2022-11-24 09:32:58 -06:00
David Garske 0a38553909
Merge pull request #5798 from JacobBarthelmeh/python
account for 'pulled' error nodes
2022-11-23 14:57:03 -08:00
Anthony Hu 6190666108 Support for Analog Devices MAXQ1080 and MAXQ1065 2022-11-23 11:57:31 -05:00
Jacob Barthelmeh b6ae17804a update comments and check error case 2022-11-22 11:22:38 -07:00
Daniel Pouzzner 2fa206dec0 wolfcrypt/src/siphash.c: fix bugprone-macro-parentheses, and in wc_SipHash(), fix clang-diagnostic-overlength-strings around inline asm. 2022-11-18 22:43:13 -06:00
JacobBarthelmeh 34f8fa797e
Merge pull request #5695 from embhorn/gh5693
Fix --enable-devcrypto build error for sys without u_int8_t type
2022-11-17 16:01:35 -07:00
JacobBarthelmeh 143dac64a3 account for 'pulled' error nodes 2022-11-17 14:51:37 -08:00