Page 1 of 1

Flash encryption effect on ESP32 speed

Posted: Tue Dec 12, 2017 1:18 pm
by Vader_Mester
Hello Fellow Forumers,

Does anyone have actual data, information or insight on how much would flash encryption and secure boot slow down the ESP32?

Thanks for the answers in advance!

Re: Flash encryption effect on ESP32 speed

Posted: Wed Dec 13, 2017 5:44 am
by ESP_Angus
Hi Vader,

Secure Boot adds additional boot time when the app starts from reset, approximately +600ms. This is because the bootloader needs to calculate & verify two ECDHE signatures (partition table and app). We're looking at ways to reduce this overhead. After the app starts, secure boot adds no overhead unless verifying an OTA image (in which case it also takes an extra ~300ms to verify the app's signature).

Flash Encryption adds a minimal amount of latency when executable code is read into the internal flash cache (ie whenever the app is running). I don't have exact numbers, and it will depend on the software workload, but it should be quite minor (likely unnoticeable for normal operations).

Writing to encrypted flash is slower than writing to unencrypted flash, probably by a factor of 2-2.5 (again, this depends on the write sizes.)

Angus

Re: Flash encryption effect on ESP32 speed

Posted: Wed Dec 13, 2017 6:52 am
by Vader_Mester
Off-Topic:
@ESP_Angus - I was hoping for (but didn't expect it, having experience from other community forums), that an aswer would be given by an Espressif member himself! Not only did it happen, but such quickly :o ???
This soooooo rare nowdays, and shows the Espressif's love for a community!
This is awsome! :mrgreen:

Thanks for the quick answer, and keep up the good work! Love the community, and it will love you back :!:
---------------------------------------------------------------

Back to the subject:
I think that if this is not much of a toll, then it shall be fine.
I would not really use the Flash for writing to it.

If I use a SPI-RAM parallel with the Flash (i heared it's possible), then does the Flash encryption affect SPI-RAM writes? It shouldn't but I know how much the handling of the SPI-FLASH and SPI-RAM is related to each other hardware wise, so I'm just curious. I wanna use just a little external RAM using as a circular buffer for my Microphone audio signals :geek:

Re: Flash encryption effect on ESP32 speed

Posted: Thu Dec 14, 2017 8:47 am
by ESP_Sprite
Flash encryption should not affect the SPI PSRAM in a major way (maybe a read/write will happen a clock cycle or two later because it'll need for a slightly delayed flash write cycle). Be aware, however, that unlike the flash, SPI PSRAM does not have hardware encryption in the ESP32.