[feat][mbedtls] add mbedtls component

This commit is contained in:
jzlv 2021-09-23 19:17:27 +08:00
parent b0e709d9d6
commit f098272250
219 changed files with 149965 additions and 0 deletions

View file

@ -0,0 +1,19 @@
#ifndef MBEDTLS_CONFIG_H
#define MBEDTLS_CONFIG_H
#include "mbedtls_port_config.h"
#define MBEDTLS_AES_C
#define MBEDTLS_AES_ROM_TABLES
#define MBEDTLS_CCM_C
#define MBEDTLS_CIPHER_C
#define MBEDTLS_SHA256_C
#define MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_CIPHER_MODE_CTR
// #define MBEDTLS_PLATFORM_MEMORY
// #define MBEDTLS_PLATFORM_FREE_MACRO
// #define MBEDTLS_PLATFORM_CALLOC_MACRO
#endif /* MBEDTLS_CONFIG_H */

View file

@ -0,0 +1,27 @@
#ifndef __MBEDTLS_PORT_CONFIG_H__
#define __MBEDTLS_PORT_CONFIG_H__
#include "bflb_platform.h"
#include "bl702_sec_eng.h"
#define MBEDTLS_USE_BFLB_SHA
#define MBEDTLS_USE_BFLB_AES
#define MBEDTLS_USE_BFLB_TRNG
#define MBEDTLS_USE_BFLB_PKA
#define MBEDTLS_USE_BFLB_GMAC
#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
#define MBEDTLS_PLATFORM_PRINTF_MACRO MSG
#define MBEDTLS_PLATFORM_SNPRINTF_ALT
//#define MBEDTLS_PLATFORM_STD_SNPRINTF snprintf
#define MBEDTLS_PLATFORM_MEMORY
//#if defined(bflb_platform_calloc) && defined(bflb_platform_free)
//#define MBEDTLS_PLATFORM_CALLOC_MACRO bflb_platform_calloc
//#define MBEDTLS_PLATFORM_FREE_MACRO bflb_platform_free
//#endif
#ifndef SIZE_MAX
#define SIZE_MAX 0xffffffff
#endif
#endif