Following on from this, what I’ve found works for your own local copy of MBEDTLS (using local compilation rather than WebIDE) is:
Create a new application folder, for example ‘myapp’
Create subfolder mbedtls
Copy mbedtls library/.c in to myapp
Copy mbedtls/include/mbedtls/.h in to myapp/mbedtls
Copy config-suite-b.h (or another of the example config files) to mbedtls/config.h
Write your application code ’application.cpp’ (in to myapp folder)
Add header #include lines in to application.cpp as needed for compilation
Edit config.h as appropriate for your requirements, but including these three amendments:
- Comment out: #define MBEDTLS_NET_C
- Add #define MBEDTLS_NO_PLATFORM_ENTROPY
- Remove “mbedtls” from #include “mbedtls\check_config.h” line (near end of file) so it reads #include “check_config.h”
Compile. It doesn’t seem to matter that you have added the entire mbedtls *.c and *.h because when it compiles it only links in what you’ve used. The tricky part of all of this is getting config.h correct. I’ve not tried AES so you may need to include some of the AES directives (the #includes) to get AES to compile and run.
Note: I don’t use WebIDE, but suspect that you’d need to edit the *.h and *.c files to flatten the structure, in which case you would probably want to just copy in the files you actually need rather than the entire mbedtls suite.