Hi Ronald! Thank you for the suggestions. I have run some tests and have some numbers for you.
Hashing 100kb with sha256 on cortex-m7 board: 1. Current performance on master branch: ~5.2 million cycles 2. Removing call to mbedtls_platform_zeroize in mbedtls_internal_sha256_process_c: ~2.7 million cycles 3. Only calling mbedtls_platform_zeroize on the last block (by passing another argument to mbedtls_internal_sha256_process_c) : ~2.9 million cycles
Turns out I overestimated the slowdown in my original post, as it is closer to 50% - but with your suggestion we are back to almost the same numbers as before. // Joel