Commit Graph

334 Commits

Author SHA1 Message Date
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
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
Jacob Barthelmeh
177f4aecb6 add all curves to benchmark 2021-01-22 03:20:41 +07:00
Jacob Barthelmeh
e3fa462d72 add brainpool benchmark of key generation 2021-01-22 02:55:26 +07:00
JacobBarthelmeh
fe37137f12 add brainpool benchmark 2021-01-22 02:44:11 +07:00
David Garske
17f101ef13 Fix for ARM Keil MDK compiler issue with DECLARE_VAR_INIT. 2021-01-20 16:57:30 -08:00
David Garske
9ea5041d9d Benchmark for GMAC (AES GCM GHASH). 2021-01-19 13:42:25 -08:00
Sean Parkinson
6a5e802cc4 Disable algs: fix code to compile with various algs off/on
benchmark.c: Only X25519/Ed25519/X448/Ed448 now compiles
asn.c/asn.h: Only DSA now compiles
2021-01-19 09:54:21 +10:00
Jacob Barthelmeh
a948066f86 some infer fixes 2020-12-17 01:49:48 +07:00
toddouska
bd871280d7 Merge pull request #3497 from elms/erf32/se_acceleration
ERF32: HW acceleration
2020-12-14 15:43:15 -08:00
Sean Parkinson
dbe4ce0e24 SP: Get RSA verify only to build with DH
Fix configuration: --enable-rsavfy --enable-sp --enable-cryptonly
[--enable-sp-asm]
2020-12-07 09:46:14 +10:00
Elms
9f7ef0b3e6 SiLabs: Add ECC hardware acceleration support 2020-11-30 21:01:49 -08:00
Elms
1899a72d27 Micrium: benchmark fixes
* Time update for v5.8 to avoid rollover issues
 * define `XSNPRINTF`
 * `printf` based on Micrium version
2020-11-30 16:32:30 -08:00
Sean Parkinson
91d23d3f5a Implement all relevant mp functions in sp_int 2020-11-19 11:58:14 +10:00
Daniel Pouzzner
5fe1586688 fix 34 deadcode.DeadStores detected by llvm11 scan-build. 2020-11-11 13:04:14 -06:00
David Garske
063fb2cfa0 Merge pull request #3455 from douzzer/linuxkm-install-rules
add "module", "modules_install", and "clean_module" rules for linuxkm
2020-11-05 09:09:35 -08:00
Daniel Pouzzner
2d149b1bef benchmark.c: backport fixes to bench_dh() DH key size initialization from SparkiDev:sp_math_all. 2020-11-04 15:35:58 -06:00
Daniel Pouzzner
3858bda7e9 add "module", "modules_install", and "clean_module" rules to BUILD_LINUXKM section of Makefile.am, and add working install rule to linuxkm/Makefile, so that "make module" and "make modules_install" now work when --enable-linuxkm; fix "make dist" logic in Makefile.am and scripts/include.am to be unaffected by --enable-linuxkm; don't build wolfcrypt/benchmark or testwolfcrypt when --enable-linuxkm and --enable-crypttests. 2020-11-04 14:13:39 -06:00
John Safranek
dbf18b8532 Test ECC-521 Only
Update benchmark and wolfcrypt test to support using only ECC-521 in a custom curve list.
2020-09-28 09:22:24 -07:00
Daniel Pouzzner
60a686f48c tidying suggested by Sean in review. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
8b19a9b58c benchmark.c: fix always-true tests for DECLARE_VAR_IS_HEAP_ALLOC. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
6c32a730c2 more work on DECLARE_VAR -- fix allocation failure handling in bench_rsa_helper() to avoid uninitialized variables. 2020-09-23 18:32:16 -05:00
Daniel Pouzzner
426de2101a more work on DECLARE_VAR -- proper handling of failed allocations. WIP. 2020-09-23 18:32:16 -05:00
David Garske
083f143c89 Fixes for warnings with minimum ECC build. 2020-08-21 15:47:02 -07:00
David Garske
25f9d15980 Fix for benchmark example when using the ECC encrypt (--enable-eccencrypt) and timing resistance. New timing resistance RNG requirements for ECC Shared Secret. 2020-08-20 14:25:06 -07:00
John Safranek
3f6861ee82 FIPS Ready Fix with ECC Timing Resistance
Commit 6467de5 added some timing resistance to ECC shared secret
agreement. It involved adding an RNG object to the ecc keys so
a random z value can be added to the mix. The older FIPS release
has ECC outside the boundary, so it uses the new ECC code. FIPSv2
has ECC inside the boundary, but all the TLS code checks for that
version of FIPS and leaves out the calls to the new functions as
it is using an older version of ecc.c. FIPS Ready uses the latest
version of ecc.c but compiles as FIPSv2. So, the code outside of
the crypto layer is treating ECC as FIPSv2 and not calling the new
functions, but the crypto layer assumes the RNG should be present,
and errs out on testing.
1. Added a separate option for FIPS Ready to the enable-fips
   configure option. `--enable-fips=ready`. It will treat FIPS
   Ready as the next kind of FIPS release. FIPS Ready will be
   treated like FIPS v3 in the build.
2. Changed the C preprocessor checks for FIPS version 2 to be
   checks for not version 2, with respect to ECC Timing Resistance
   and FIPS builds.
2020-08-14 10:54:55 -07:00
Sean Parkinson
6467de5a88 Randomize z ordinates in scalar mult when timing resistant
An RNG is required for shared secret calculation now.
Use wc_ecc_set_rng() to set an RNG against the ECC object.
ECC verification does not need timing resistance and does not randomize
z ordinates.
2020-08-11 16:12:47 +10:00
David Garske
9160a126e4 Fixes for running wolfCrypt test/benchmark with SECP256R1 disabled. Improved detection of ECC key generation size. 2020-07-28 11:43:48 -07:00
David Garske
d43d75bf81 Updates to xcode projects to add new files.
Ran updated iPhone X benchmarks:

```
RNG                330 MB took 1.010 seconds,  326.879 MB/s
AES-128-CBC-enc    920 MB took 1.005 seconds,  915.507 MB/s
AES-128-CBC-dec   6095 MB took 1.000 seconds, 6092.130 MB/s
AES-192-CBC-enc    820 MB took 1.000 seconds,  819.644 MB/s
AES-192-CBC-dec   4860 MB took 1.001 seconds, 4855.794 MB/s
AES-256-CBC-enc    710 MB took 1.005 seconds,  706.419 MB/s
AES-256-CBC-dec   3935 MB took 1.001 seconds, 3930.830 MB/s
AES-128-GCM-enc   1245 MB took 1.003 seconds, 1241.589 MB/s
AES-128-GCM-dec    575 MB took 1.001 seconds,  574.547 MB/s
AES-192-GCM-enc   1235 MB took 1.001 seconds, 1234.343 MB/s
AES-192-GCM-dec    570 MB took 1.003 seconds,  568.521 MB/s
AES-256-GCM-enc   1230 MB took 1.003 seconds, 1226.034 MB/s
AES-256-GCM-dec    570 MB took 1.001 seconds,  569.199 MB/s
3DES                10 MB took 1.386 seconds,    7.213 MB/s
MD5                 95 MB took 1.037 seconds,   91.629 MB/s
SHA                 80 MB took 1.013 seconds,   78.943 MB/s
SHA-256           1625 MB took 1.000 seconds, 1624.565 MB/s
SHA3-224            60 MB took 1.010 seconds,   59.399 MB/s
SHA3-256            60 MB took 1.073 seconds,   55.921 MB/s
SHA3-384            45 MB took 1.042 seconds,   43.195 MB/s
SHA3-512            35 MB took 1.164 seconds,   30.063 MB/s
HMAC-MD5            95 MB took 1.044 seconds,   91.014 MB/s
HMAC-SHA            80 MB took 1.007 seconds,   79.480 MB/s
HMAC-SHA256       1705 MB took 1.001 seconds, 1703.126 MB/s
RSA     2048 public      32800 ops took 1.003 sec, avg 0.031 ms, 32716.405 ops/sec
RSA     2048 private      1200 ops took 1.041 sec, avg 0.868 ms, /33 ops/sec
DH      2048 key gen      2354 ops took 1.000 sec, avg 0.425 ms, 2353.254 ops/sec
DH      2048 agree        2500 ops took 1.013 sec, avg 0.405 ms, 2467.525 ops/sec
ECC      256 key gen     46503 ops took 1.000 sec, avg 0.022 ms, 46502.069 ops/sec
ECDHE    256 agree       14100 ops took 1.005 sec, avg 0.071 ms, 14034.697 ops/sec
ECDSA    256 sign        29600 ops took 1.003 sec, avg 0.034 ms, 29500.554 ops/sec
ECDSA    256 verify      11000 ops took 1.007 sec, avg 0.092 ms, 10921.516 ops/sec
```
2020-06-12 10:39:26 -07:00
JacobBarthelmeh
6a7a8fa5b7 updated RSA calls to Xilsecure 2020-05-19 19:27:21 -06:00
David Garske
6185e0f477 Remove execute bit on files. 2020-04-27 11:16:02 -07:00