why all Hmac function are blank?

wziy520
Posts: 42
Joined: Thu Nov 10, 2016 7:58 am

why all Hmac function are blank?

Postby wziy520 » Mon Mar 13, 2017 9:48 am

there are no any Hmac function avilable? , Does Esp have plan support the hmac about SHA1 && SHA2?
there are no right side function.

#define sha1_hmac mbedtls_sha1_hmac
#define sha1_hmac_finish mbedtls_sha1_hmac_finish
#define sha1_hmac_reset mbedtls_sha1_hmac_reset
#define sha1_hmac_starts mbedtls_sha1_hmac_starts
#define sha1_hmac_update mbedtls_sha1_hmac_update

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

Re: why all Hmac function are blank?

Postby ESP_Angus » Tue Mar 14, 2017 7:09 am

The compat-1.3.h header (where these macros are found) provide backwards compatibility for mbedTLS to work with code written for PolarSSL (which became mbedTLS). They shouldn't be used for new code, as PolarSSL no longer exists (last major release was 2013 or 2014). I think in recent versions mbedTLS has changed some functions (like these) so they will no longer work with PolarSSL APIs at all, but they forgot to remove the compatibility macros.

To calculate SHA1 HMAC in mbedTLS, include <mbedtls/md.h> and use their generic message digest functions configured for SHA1 HMAC mode:
https://github.com/espressif/esp-idf/bl ... s/md.h#L39


Angus

Who is online

Users browsing this forum: No registered users and 93 guests