hash.c 371 B

1234567891011121314151617181920
  1. /*
  2. * hash.c
  3. *
  4. * Created on: 06.12.2016
  5. * Author: pavel
  6. */
  7. #include "lwip/arch.h"
  8. #include "mbedtls/md5.h"
  9. #include "hash.h"
  10. void md5hash(unsigned char *hash, unsigned char *msg, unsigned int msg_len) {
  11. mbedtls_md5_context mdContext;
  12. mbedtls_md5_starts(&mdContext);
  13. mbedtls_md5_update(&mdContext, msg, msg_len);
  14. mbedtls_md5_finish(&mdContext, hash);
  15. }