mbedCrypto is a crossplatform, open source, free to use and modify cryptolibrary for embedded devices and software. The key idea is to provide flexibal usage with support both FW and HW at the same time. Each cryptoalgotihthm can be successfuly used independently that allows to use for example HW SHA implementation with FW HMAC. The project use both regular and special tests. Regular tests are: unit, functional and system. Special tests are algorithm dependent. For FIPS standardized algorithms CAVP testing is used.For that purpose created a special framework. The library includes wide documentation with doxygen, proper codestyle and CERT implementation.
- Easy to use
- Wide range of algorithms
- Can be used both for embedded systems and for software applications
- Independent algorithm implementation
- Supports 3 secure levels
- Side attack protection
- Simple and wide library configuration
By default library supports a set of different architectures. Architecture dependent implementation can support both native compilation and crosscompilation. Supported architectures:
- X86-32
- X86-64
- ARM32
- ARM64
Before to be compiled for testing or usage as a compiled library the project has to be configured. It can be done manually or by KConfig. Via TUI:
make menuconfig
Via console:
make config
CI/CD use special configuration with name test.config
. By default config file use name .config
.
The library can be successfully used both as a plain sources and compiled libraries(shared, static). Build to test:
make tests
Build shared lib:
make shared
Build static lib:
make static
To start unit, functional and system tests the library should be configured first. Then build with make tests:
make clean
make tests_config
make tests
./mbcrypt_tests
LIB | URL |
---|---|
libtommath | libtommath |
cmocka | cmocka |
CAVP_Tester | CAVP_Tester |
Want to contribute? Great!
Library use special projects for different purposes.
Regarding to crypto algorithm. Each of them has four stages:
- Zero(0) - algorithm not implemented at all or implemented not enough
- Raw(1) - stage when a base set of operation implemented with a minimum security level and protection
- PreRelease(2) - algorithm has all the protections and main implementations
- Release(3) - the last stage. Algorithm can be used for any purposes. Has lots of tests and protections. Supports all the architectures present.
Also prefix +
means algorithm has full testing. e.g. In change log SHA256__2+ means that SHA256 in PreRelease state with fully covered with tests.
See PR_TEMPLATE or BUG_REQUEST template.
....
....
....