Page 1 of 1

libsodium and hardware acceleration

Posted: Wed Feb 13, 2019 7:46 pm
by espdude
Hi,

Does libsodium included in IDF use any hardware acceleration? I am particularly interested in
crypto_kx_* and crypto_aead_xchacha20poly1305_ietf_* constructions.

Thank you

Re: libsodium and hardware acceleration

Posted: Thu Feb 14, 2019 12:17 am
by ESP_Angus
Unfortunately not, right now libsodium use software implementations. Only mbedTLS can enable hardware acceleration (ESP32 can accelerate AES, SHA and some RSA/bignumber calculations).

For ChaCha20 & Poly1305, there isn't any hardware support in the ESP32 that would accelerate these algorithms. They should be pretty fast in software already, especially if using the 240MHz CPU speed.

The x25519 key exchange used by the crypto_kx_ algorithms may be a little faster if you use the mbedTLS implementation with hardware acceleration, depending on circumstances.