/********************************************************************* * PicoTCP. Copyright (c) 2015 Altran Intelligent Systems. Some rights reserved. * See LICENSE and COPYING for usage. * * Authors: Daniele Lacamera * *********************************************************************/ #include #if defined (PICO_SUPPORT_CYASSL) #include void pico_md5sum(uint8_t *dst, const uint8_t *src, size_t len) { Md5 md5; InitMd5(&md5); Md5Update(&md5, src, len); Md5Final(&md5, dst); } #elif defined (PICO_SUPPORT_POLARSSL) #include void pico_md5sum(uint8_t *dst, const uint8_t *src, size_t len) { md5(src, len, dst); } #else static void (*do_pico_md5sum)(uint8_t *dst, const uint8_t *src, size_t len); void pico_md5sum(uint8_t *dst, const uint8_t *src, size_t len) { if (do_pico_md5sum) { do_pico_md5sum(dst, src, len); } } void pico_register_md5sum(void (*md5)(uint8_t *, const uint8_t *, size_t)) { do_pico_md5sum = md5; } #endif