Commit Graph

167 Commits (132357fefef0a716f78557b5c4606b9caaf09b51)

Author SHA1 Message Date
ccli8 778143f467 Refine internal_mpi_write_eccreg in ECP alter. 2018-02-23 17:08:31 -06:00
ccli8 4b33c9343b Support internal self-test for ECP alter. 2018-02-23 17:08:31 -06:00
ccli8 6c962c7c21 Remove mbedtls_internal_ecp_mul in ECP alter.
MbedTLS doesn't support point multiplication for MBEDTLS_ECP_INTERNAL_ALT acceleration configuration.
2018-02-23 17:08:31 -06:00
ccli8 d53641b564 Remove mbedtls prefix for internal functions in ECP alter. 2018-02-23 17:08:31 -06:00
ccli8 8c18a906bc Check divisor is not zero in MODOP_DIV operation in ECP alter. 2018-02-23 17:08:31 -06:00
ccli8 0de10b010d Refine code in ECP alter.
1. Add comment for unnecessary parameter 'n' in mbedtls_internal_run_eccop
2. Fix warning message with goto which causes `bypass initialization`
3. Fix comment
2018-02-23 17:08:31 -06:00
ccli8 0eb60860f6 Support ECP H/W accelerator 2018-02-23 17:08:30 -06:00
Wilfried Chauveau 82d16294cb rename MURATA type ABZ & WISE_1510 to their expected name 2018-02-09 14:18:46 +00:00
Kimmo Vaisanen 3c5af68180 Add MTB_ADV_WISE_1570 target 2018-02-09 14:18:46 +00:00
adustm 52eb2b7f3e Remove last code redundancy 2018-02-09 14:18:42 +00:00
adustm acea1bda7c Improve fix calling Accumulate function every time in finish function 2018-02-09 14:18:42 +00:00
adustm 143b44815d Fix MD5 link issue 2018-02-09 14:18:42 +00:00
adustm 192de3f4ec Fix #5079. Add the support of call to mbedtls_xxx_finish even if mbedtls_xxx_udate was not called since mbedtls_xxx_start 2018-02-09 14:18:42 +00:00
Wilfried Chauveau 8340f5041a add support for STM32L443RC & WISE-1510 2018-02-09 14:18:42 +00:00
ccli8 51087a9f50 Fix DMA input/output buffers are overlapped in AES alter. 2018-01-12 15:01:47 +00:00
ccli8 5938e6b73a Remove unnecessary H/W context clone functions in SHA alter. 2018-01-12 15:01:47 +00:00
ccli8 2caeb92b5f Fix context clone corner case in SHA alter.
As destination/source contexts are the same, we return immediately.
2018-01-12 15:01:47 +00:00
ccli8 fd650adcee Fix indefinite loop in SHA alter. 2018-01-12 15:01:47 +00:00
ccli8 0243435047 Remove duplicate configuration of CRPT->SHA_CTL/CRPT->HMAC_CTL in SHA alter. 2018-01-12 15:01:47 +00:00
ccli8 e352fc48bd Use interrupt signal rather than polling to check operation completion in DES alter.
This is to be consistent with PRNG/AES.
2018-01-12 15:01:47 +00:00
ccli8 274a54eb8b Refine flow control code between crypto start and crypto ISR 2018-01-12 15:01:47 +00:00
ccli8 c0fe23b1ef Refine code in SHA alter. 2018-01-12 15:01:46 +00:00
ccli8 da84f715bf Add memory barrier for DMA transfer in AES/DES alter. 2018-01-12 15:01:46 +00:00
ccli8 c8c980473a Call BSP driver rather than direct register access in DES alter. 2018-01-12 15:01:46 +00:00
ccli8 523ca0a7e4 Fix parameter check for TMODE/OPMODE in DES alter. 2018-01-12 15:01:46 +00:00
ccli8 acbc4e49ba Add parameter check for configuring DES registers in DES alter. 2018-01-12 15:01:46 +00:00
ccli8 ada9a9e248 Refine comment with BSP driver use in DES alter. 2018-01-12 15:01:46 +00:00
ccli8 7bd32f2bd4 Fix multiple calls to SHA free in SHA alter. 2018-01-12 15:01:46 +00:00
ccli8 1c8128831b Remove superfluous code in AES alter. 2018-01-12 15:01:46 +00:00
ccli8 5498bdad87 Refine code with SHA context selection in SHA alter. 2018-01-12 15:01:46 +00:00
ccli8 2ba799462a Guard against SHA internal state size is not word-aligned in SHA alter. 2018-01-12 15:01:46 +00:00
ccli8 e1714d1d58 Fix SHA H/W resource leakage in context cloning 2018-01-12 15:01:46 +00:00
ccli8 e7f75b069f Fix SHA H/W is not stopped in corner case
Take SHA1 for example, without the fix, SHA H/W is not stopped in either case:
(1) ctx->total == 0 in mbedtls_sha1_hw_finish()
(2) mbedtls_sha1_hw_finish() is not called by upper layer
2018-01-12 15:01:46 +00:00
ccli8 402d2d26ec Strengthen crypto DMA buffer check
1. Catch incompatible buffer range, where buffer base = 0xffffff00 and buffer size = 0x100.
2. Add buffer size alignment check.
2018-01-12 15:01:46 +00:00
ccli8 0b51602734 Refine AES/DES alter. DMA buffer requirement comment 2018-01-12 15:01:46 +00:00
ccli8 ad7024687e Fix compile error with disabled crypto
For example, even though MBEDTLS_SHA512_C is disabled (via #undef MBEDTLS_SHA512_C),
mbedtls_sha512_context is still necessary due to referenced in sha512.h.
2018-01-12 15:01:46 +00:00
ccli8 56087fe0a4 Fix compile error as mbedtls is not included
Currently, trng_api.c is located in targets/ and AES/DES/SHA alter. are located in mbedtls/.
They have shared crypto code.
If they could locate at same location e.g. mbedtls/, the shared crypto code placement would be more reasonable.
2018-01-12 15:01:46 +00:00
ccli8 0a56b34d0e Refine AES alter. key endianness code 2018-01-12 15:01:46 +00:00
ccli8 77c53f8d06 Coordinate crypto interrupt handler among AES/PRNG 2018-01-12 15:01:46 +00:00
ccli8 d6987bb6be Refine AES/DES alter. code 2018-01-12 15:01:46 +00:00
ccli8 a89cb2e5b9 Fix AES alter. CFB128 error 2018-01-12 15:01:45 +00:00
ccli8 9c52660e52 Optimize AES alter. code 2018-01-12 15:01:45 +00:00
ccli8 1f3565ec35 Guard from re-entry into crypto H/W 2018-01-12 15:01:45 +00:00
ccli8 41f4e1a12c Coordinate crypto init among AES/DES/SHA/PRNG
Add counter to track crypto init among crypto sub-modules. It includes:
1. Enable crypto clock
2. Enable crypto interrupt

As counter gets zero, crypto clock is disabled to save power.
2018-01-12 15:01:45 +00:00
ccli8 5785ecfb76 Fix DES alter. DMA buffer could locate at unsupported region 2018-01-12 15:01:45 +00:00
ccli8 416c4fa7f6 Fix AES alter. DMA buffer could locate at unsupported region 2018-01-12 15:01:45 +00:00
ccli8 e60198e946 Refine AES alter. input/output data endianness 2018-01-12 15:01:45 +00:00
ccli8 bc366a1c31 Fix AES alter. DMA buffer check 2018-01-12 15:01:45 +00:00
ccli8 2ddc1410f0 Refine config check code 2018-01-12 15:01:45 +00:00
ccli8 60cbdac383 Remove redundant S/W DES code
This S/W DES code was to test DES H/W port before.
2018-01-12 15:01:45 +00:00