Description
When thinking about the recent "tls slow?" thread on the maillist, it occurred to me that a lot of the stuff that mbedTLS does is actually CPU-bound, and this is actually a perfect example of a good use case for the "clock doubling" capabilities built into the ESP8266.
We should look into potentially bumping the clock rate up to 160MHz whenever mbedTLS needs to do cryptographic operations which would otherwise be too slow. I'm not sure exactly the best way to implement this, as it would most likely require modifying the internals of mbedTLS itself to add calls to sdk_system_overclock
/ sdk_system_restoreclock
in the right places.. I haven't looked at whether there's any mechanism already built into mbedTLS which might allow us to do hooks like this without modifying its source directly, though.. (Alternately, if not we might be able to come up with a hook mechanism which could be accepted upstream and we could then use so we wouldn't have to maintain a custom mbedTLS source..)