Page 1 of 1

MD5 hardware accelerator example

Posted: Mon Sep 10, 2018 8:38 am
by davdav
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

Re: MD5 hardware accelerator example

Posted: Tue Sep 11, 2018 12:04 am
by ESP_Angus
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.

Re: MD5 hardware accelerator example

Posted: Wed Sep 12, 2018 12:01 pm
by davdav
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.

Re: MD5 hardware accelerator example

Posted: Thu Sep 13, 2018 12:06 am
by ESP_Angus
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.