mbed-os/features/cryptocell/FEATURE_CRYPTOCELL310
Martin Kojtal 985afb8027
Merge pull request #8728 from RonEld/cryptocell_sha_alt_fixes
Fix issues in Cryptocell 310 shax_alt discovered by On Target Testing
2018-12-12 14:43:06 +01:00
..
TARGET_MCU_NRF52840 Change Mbed TLS platform error code and value 2018-10-15 16:21:54 +03:00
binaries Remove redundant Cryptocell libraries 2018-05-31 18:15:25 +03:00
include Change Cryptocell target to a feature 2018-05-21 13:40:43 +03:00
Readme.md Add reference counter for platform context 2018-06-04 10:38:49 +03:00
cc_internal.c Merge pull request #8797 from RonEld/cryptocell_ecc_errors_alt_fixes 2018-11-30 17:51:50 -06:00
cc_internal.h Modify HW accelerator drivers to new error code 2018-11-11 09:59:18 +02:00
ccm_alt.c Add the platform generic errors 2018-11-26 15:33:17 +02:00
ccm_alt.h Style fixes 2018-11-26 15:32:46 +02:00
ecdh_alt.c Modify HW accelerator drivers to new error code 2018-11-11 09:59:18 +02:00
ecdsa_alt.c Modify HW accelerator drivers to new error code 2018-11-11 09:59:18 +02:00
ecdsa_alt.c.mod Change Cryptocell target to a feature 2018-05-21 13:40:43 +03:00
mbedtls_device.h Change Cryptocell target to a feature 2018-05-21 13:40:43 +03:00
objects_cryptocell.h Change Cryptocell target to a feature 2018-05-21 13:40:43 +03:00
sha1_alt.c Return not supported for internal process function 2018-11-28 15:31:55 +02:00
sha1_alt.h Style fixes 2018-11-28 15:31:17 +02:00
sha256_alt.c Return not supported for internal process function 2018-11-28 15:31:55 +02:00
sha256_alt.h Style fixes 2018-11-28 15:31:17 +02:00
trng.c Fix build error on IAR 2018-09-02 10:48:31 +03:00

Readme.md

Guidelines for porting Cryptocell to Mbed OS

Cryptocell (CC) 310 is a hardware accelerator that can be ported to several boards, assuming these boards have CC 310 embedded in their hardware.

The CC 310 driver consists of three libraries:

  • A common core library(libcc_core.a).
  • A platform-specific TRNG library, containing TRNG-related information, for sampling sufficient entropy on the specific platform(libcc_trng.a).
  • A platform-specific library containing extra information, such as the CC register's base addresses on the specific board. (libcc_ext.a)

To port your CC 310 driver to Mbed OS on your specific target, do the following:

  1. In targets.json add the following to your target:
    • MBEDTLS_CONFIG_HW_SUPPORT to macros_add key. This instructs Mbed TLS to look for an alternative cryptographic implementation.
    • CRYPTOCELL310 to feature. Use this in your common code that you need to remove from compilation in case CC exists in your board. Use #if !defined(FEATURE_CRYPTOCELL310) and #if defined(FEATURE_CRYPTOCELL310).
  2. In objects.h, include objects_cryptocell.h. You can use the FEATURE_CRYPTOCELL310 precompilation check as defined above.
  3. In features/cryptocell/FEATURE_CRYPTOCELL310/TARGET_<target name>, add your platform-specific libraries for all toolchains in TOOLCHAIN_ARM, TOOLCHAIN_GCC_ARM and TOOLCHAIN_IAR respectively.
  4. Add your CC setup code:
    • Implement crypto_platform_setup() and crypto_platform_terminate() to enable CC on your platform, in case you have board-specific setup functionality, required for CC setup. You MUST call 'SaSi_LibInit()` and 'SaSi_LibFini()' respectively in these functions.
    • Define crypto_platform_ctx in crypto_platform.h in a way that suits your implementation.