libsodium and hardware acceleration

espdude
Posts: 4
Joined: Fri Jul 27, 2018 4:21 am

libsodium and hardware acceleration

Postby espdude » Wed Feb 13, 2019 7:46 pm

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

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: libsodium and hardware acceleration

Postby ESP_Angus » Thu Feb 14, 2019 12:17 am

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.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 309 guests