bl_mcu_sdk/examples/littlefs/kv_test/arch_crypto.c
jzlv 356f258e83 [sync] sync from internal repo
* use nuttx libc, disable system libc
* use tlsf as default
* update lhal flash driver
* add example readme
* add flash ini for new flash tool
* add fw header for new flash tool
2023-01-17 21:04:07 +08:00

16 lines
356 B
C
Executable file

#include "arch_crypto.h"
#include "arch_dbg.h"
#include <mbedtls/aes.h>
#include <mbedtls/md5.h>
#include <stdint.h>
void arch_md5(uint8_t *input, int len, uint8_t hash[16])
{
mbedtls_md5_context context;
mbedtls_md5_init(&context);
mbedtls_md5_starts(&context);
mbedtls_md5_update(&context, input, len);
mbedtls_md5_finish(&context, hash);
}