Commit graph

79 commits

Author SHA1 Message Date
Angus Gratton
88b264cfce mbedTLS SHA: Fix cloning of SHA-384 digests
Hardware unit only reads 384 bits of state for SHA-384 LOAD,
which is enough for final digest but not enough if you plan to
resume digest in software.
2016-11-25 19:26:30 +11:00
Angus Gratton
d0801fdbab Merge branch 'feature/sha_tls_integration' into 'master'
SHA acceleration integrated to mbedTLS incl. TLS sessions

Uses hardware SHA acceleration where available, fails over to software where not available.

Ref TW7112

See merge request !232
2016-11-25 10:12:29 +08:00
Angus Gratton
79646f41b5 Fixes for stdlib.h inclusion
Refs:
http://esp32.com/viewtopic.php?f=13&t=550
http://esp32.com/viewtopic.php?f=13&t=551

rmt.c should include stdlib.h for malloc, esp_bignum,c &
https_request_main.c for abort().

FreeRTOSConfig.h is only including stdlib if
CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION is set. However, it is
included for abort() so needs to be included whenever
CONFIG_FREERTOS_ASSERT_FAIL_ABORT is set.

This change includes unconditionally in FreeRTOSConfig.h. This is to
avoid this kind of bug where compiler errors are dependent on config. I
suggest we don't change this to be more selective until we have 'make
randomconfig' style tests in CI.
2016-11-24 08:20:21 +11:00
Angus Gratton
2561b68af8 hwcrypto: Fixes for disabling one hardware unit causing reset of a different unit
ROM functions reset related units, but this can have problems in a
multithreaded environment.
2016-11-22 20:42:38 +11:00
Angus Gratton
c48612e516 mbedTLS SHA acceleration: Allow concurrent digest calculation, works with TLS
SHA hardware allows each of SHA1, SHA256, SHA384&SHA512 to calculate digests
concurrently.

Currently incompatible with AES acceleration due to a hardware reset problem.

Ref TW7111.
2016-11-22 20:42:38 +11:00
Angus Gratton
1d47755588 mbedtls hardware bignum: Use memcpy instead of REG_WRITE/REG_READ in a loop
Removes memory barriers for better performance, thanks Ivan for pointing
this out.

Manually unrolling the loop further seemed like diminishing returns.
2016-11-21 18:09:09 +11:00
Angus Gratton
1cc0b3000b mbedtls hardware bignum: Expose ESP-only bignum API in wrapper mbedtls/bignum.h 2016-11-18 17:08:14 +11:00
Angus Gratton
36f29017b6 mbedtls hardware bignum: Support "RSA" interrupt for end of operation
Allows CPU to do other things which bignum operation is in
progress.
2016-11-18 15:53:00 +11:00
Angus Gratton
68d370542a mbedtls hardware RSA: Put into menuconfig, squash warnings
All combinations of enabling/disabling hardware acceleration no longer
show unused warnings.
2016-11-18 15:50:45 +11:00
Angus Gratton
f87be70d51 mbedtls hardware RSA: Combine methods for calculating M' & r inverse
Remove redundant gcd calculation, use consistent terminology.
Also remove leftover debugging code
2016-11-18 14:10:20 +11:00
Dong Heng
6b687b43f4 mbedtls hardware RSA: Fix "mbedtls_mpi_exp_mod" hardware calculations 2016-11-18 14:09:59 +11:00
Angus Gratton
ce7b8059de RSA Accelerator: Remove timing-sensitive optimisations
Avoid potentially leaking timing information about number of bits set in
MPI values.
2016-10-12 17:18:24 +11:00
Angus Gratton
9632c8e56c RSA Accelerator: Add mod_exp, refactor to avoid memory allocation & copying
Not fully working at the moment, mod_exp has a bug.
2016-10-12 16:19:09 +11:00
Angus Gratton
6b3bc4d8c5 hwcrypto bignum: Implement multiplication modulo
Fixes case where hardware bignum multiplication fails due to either
operand >2048 bits.
2016-10-12 15:45:08 +11:00
Angus Gratton
1a6dd44d03 hwcrypto bignum: Use mbedtls_mpi data structures for all bignum data
Still doesn't solve the problem of multiplying two numbers where one is
>2048 bits, needed for RSA support.
2016-10-12 15:45:08 +11:00
Angus Gratton
aa75a71917 mbedtls: Add some initial menuconfig options 2016-09-27 10:38:00 +10:00
Jeroen Domburg
4d4c6a3694 Enable SO_REUSEADDR in LWIP 2016-09-18 16:43:48 +08:00
Angus Gratton
67a26d52ac mbedtls: Temporarily disable default hardware crypto SHA & bignum
Due to limitations referenced in the comments of the changes.
2016-09-14 17:52:39 +10:00
Angus Gratton
f01cabf71d mbedtls hwcrypto sha512: Fix redirection of function names 2016-09-14 17:52:24 +10:00
Angus Gratton
264b115eb0 mbedtls: Move esp_config.h file to port directory 2016-09-09 14:06:14 +10:00
Angus Gratton
a939c15723 mbedtls networking: Remove WIN32 parts, minor cleanup 2016-09-09 11:24:35 +10:00
Wu Jian Gang
95defc7d32 mbedtls: Use hardware accelerated AES, SHA, bignum 2016-09-08 17:41:43 +08:00
Wu Jian Gang
fc2bfc1f49 mbedtls: just format related files
method from !46
2016-09-08 16:46:25 +08:00
liuhan
f4ff32977d components/mbedtls: modify MBEDTLS net feature
modify get the connection's 'errno' info by calling getsockopt function.
2016-09-08 16:46:21 +08:00
liuhan
1900c50d3b components/mbedtls: modify hardware encryption feature
rename "flag" and "keybites" in aes file,
rename "xxx_starts" and add license in sha file.
2016-09-08 16:45:51 +08:00
liuhan
2d80fada70 components/mbedtls: MBEDTLS Handshake result check
modify esp_config.h add some feature for support http2.0 protocol, TLS Handshake OK.
2016-09-08 16:45:44 +08:00
liuhan
98021903a2 recompile crypto and bignum function 2016-09-08 16:45:16 +08:00
liuhan
d9b660f6d4 1. add lock function for every function
2. modify some function for crypto
2016-09-08 16:44:58 +08:00
liuhan
30be5f6eb5 [t6001]: chip Use hardware acceleration of Encryption 2016-09-08 16:44:53 +08:00