drogue-iot / embedded-tls

An Rust TLS 1.3 implementation for embedded devices.
Apache License 2.0
168 stars 21 forks source link

Feature request: HW accelerated crypto #123

Open bugadani opened 1 year ago

bugadani commented 1 year ago

We should be able to parametrize embedded-tls to allow replacing software crypto with hardware implementation. This would be a giant perf win on certain MCUs, however, this seems quite a big overhaul.

We could probably base the API around https://github.com/RustCrypto/traits

newAM commented 1 year ago

This would be a good feature to have. I forget the context but I recall difficulties when I tried to use the STM hardware PKA for the RustCrypto traits.

For reference, I previously measured this for p256-cm4 on a STM32WL.

Implementation Signing Cycles (appx) Verify Cycles (appx) Flash Size (appx)
Hardware PKA 5,211,859 10,516,860 1,582 B
RustCrypto 7,856,436 14,303,277 49 kiB
p256-cm4 442,754 1,225,746 10 kiB