
#define MBEDTLS_PLATFORM_C

// Memory management
#define MBEDTLS_PLATFORM_MEMORY
#define MBEDTLS_PLATFORM_CALLOC_MACRO    innovaphone_mbedtls_calloc
#define MBEDTLS_PLATFORM_FREE_MACRO      innovaphone_mbedtls_free
#define MBEDTLS_PLATFORM_ZEROIZE_ALT
#define mbedtls_platform_zeroize         innovaphone_mbedtls_zeroize

// Random numbers
#undef MBEDTLS_ENTROPY_C
#undef MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
#define MBEDTLS_PLATFORM_ENTROPY_MACRO   innovaphone_get_random_bytes
#define MBEDTLS_CTR_DRBG_C
#define MBEDTLS_AES_C

// ECC
#define MBEDTLS_BIGNUM_C
#define MBEDTLS_ECP_C
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
#define MBEDTLS_ECP_DP_SECP521R1_ENABLED
#define MBEDTLS_ECP_NIST_OPTIM
#define MBEDTLS_HAVE_ASM

// Platform-specific implementations
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
    void * innovaphone_mbedtls_calloc(size_t num, size_t size);
    void innovaphone_mbedtls_free(void * ptr);
    int innovaphone_mbedtls_get_random_bytes(void * data, unsigned char * output, size_t len);
    void innovaphone_mbedtls_zeroize(void * data, size_t len);
#ifdef __cplusplus
}
#endif
