MD5 hardware accelerator example

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

MD5 hardware accelerator example

Postby davdav » Mon Sep 10, 2018 8:38 am

Hi all,

I would like to use hardware accelerator to compute an MD5 hash but I can't find any example.

Did someone use it?

Thanks

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

Re: MD5 hardware accelerator example

Postby ESP_Angus » Tue Sep 11, 2018 12:04 am

There is no hardware accelerator for MD5 in ESP32, only SHA1 & SHA2.

There are a set of MD5 functions in the ROM which can be used to calculate MD5 in software (with minimal code overhead in flash):
https://github.com/espressif/esp-idf/bl ... hash.h#L24

MD5 is not particularly CPU intensive, so these are quite fast.

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

Re: MD5 hardware accelerator example

Postby davdav » Wed Sep 12, 2018 12:01 pm

Thanks @ESP_Angus,

I have found MD5 function in mbedTLS component

https://github.com/espressif/mbedtls/bl ... dtls/md5.h

If you think that ROM function are better, I will switch to them.

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

Re: MD5 hardware accelerator example

Postby ESP_Angus » Thu Sep 13, 2018 12:06 am

davdav wrote: If you think that ROM function are better, I will switch to them.
They'll be slightly faster because they run from ROM, but there's no significant difference between them.

Who is online

Users browsing this forum: No registered users and 181 guests