- 下載mbedTLS 包
git clone https://github.com/ARMmbed/mbedtls.git
- 添加到工程,人比較懶 全部添加
- 添加全局宏定義
- 修改需要的功能 mbedTLS_config.h
- 編譯(如果不添加 全局宏定義,可能會出現如下錯誤)
- 測試結果
uint8_t output[20];
mbedtls_md5_ret("hello", 5, output);
UART1_SendFrame(output, 16);
mbedtls_sha1("hello", 5, output);
UART1_SendFrame(output, 20);