MCUXpresso SDK API Reference Manual  Rev 2.12.1
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
LTC: LP Trusted Cryptography

Overview

The MCUXpresso SDK provides a peripheral driver for the LP Trusted Cryptography (LTC) module of MCUXpresso SDK devices. LP Trusted Cryptography is a set of cryptograhpic hardware accelerator engines that share common registers. LTC architecture can support AES, DES, 3DES, MDHA (SHA), RSA, and ECC. The actual list of implemented cryptograhpic hardware accelerator engines depends on the specific microcontroller.

The driver comprises two sets of API functions.

In the first set, blocking synchronous APIs are provided, for all operations supported by LTC hardware. The LTC operations are complete (and results are made availabe for further usage) when a function returns. When called, these functions do not return until an LTC operation is complete. These functions use main CPU for simple polling loops to determine operation complete or error status and also for plaintext or ciphertext data movements. The driver functions are not re-entrant. These functions provide typical interface to upper layer or application software.

In the second set, DMA support for symmetric LTC processing is provided, for AES and DES engines. APIs in the second set use DMA for data movement to and from the LTC input and output FIFOs. By using these functions, main CPU is not used for plaintext or ciphertext data movements (DMA is used instead). Thus, CPU processing power can be used for other application tasks, at cost of decreased maximum data throughput (because of DMA module and transactions management overhead). These functions provide less typical interface, for applications that must offload main CPU while ciphertext or plaintext is being processed, at cost of longer cryptograhpic processing time.

LTC Driver Initialization and Configuration

LTC Driver is initialized by calling the LTC_Init() function, it enables the LTC module clock in the SIM module. If AES or DES engine is used and the LTC module implementation features the LTC DPA Mask Seed register, seed the DPA mask generator by using the seed from a random number generator. The LTC_SetDpaMaskSeed() function is provided to set the DPA mask seed.

Comments about API usage in RTOS

LTC operations provided by this driver are not re-entrant. Thus, application software shall ensure the LTC module operation is not requested from different tasks or interrupt service routines while an operation is in progress.

Comments about API usage in interrupt handler

All APIs can be used from interrupt handler although execution time shall be considered (interrupt latency of equal and lower priority interrupts increases).

LTC Driver Examples

Simple examples

Initialize LTC after Power On Reset or reset cycle Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/ltcEncrypt plaintext by DES engine Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/ltc Encrypt plaintext by AES engine Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/ltc Compute keyed hash by AES engine (CMAC) Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/ltc Compute hash by MDHA engine (SHA-256) Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/ltc Compute modular integer exponentiation Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/ltc Compute elliptic curve point multiplication Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/ltc

Modules

 LTC Blocking APIs
 

Functions

void LTC_Init (LTC_Type *base)
 Initializes the LTC driver. More...
 
void LTC_Deinit (LTC_Type *base)
 Deinitializes the LTC driver. More...
 

Driver version

#define FSL_LTC_DRIVER_VERSION   (MAKE_VERSION(2, 0, 15))
 LTC driver version. More...
 

Macro Definition Documentation

#define FSL_LTC_DRIVER_VERSION   (MAKE_VERSION(2, 0, 15))

Version 2.0.15.

Current version: 2.0.14

Change log:

  • Version 2.0.1
    • fixed warning during g++ compilation
  • Version 2.0.2
    • fixed [KPSDK-10932][LTC][SHA] LTC_HASH() blocks indefinitely when message size exceeds 4080 bytes
  • Version 2.0.3
    • fixed LTC_PKHA_CompareBigNum() in case an integer argument is an array of all zeroes
  • Version 2.0.4
    • constant LTC_PKHA_CompareBigNum() processing time
  • Version 2.0.5
    • Fix MISRA issues
  • Version 2.0.6
    • fixed [KPSDK-23603][LTC] AES Decrypt in ECB and CBC modes fail when ciphertext size > 0xff0 bytes
  • Version 2.0.7
    • Fix MISRA-2012 issues
  • Version 2.0.8
    • Fix Coverity issues
  • Version 2.0.9
    • Fix sign-compare warning in ltc_set_context and in ltc_get_context
  • Version 2.0.10
    • Fix MISRA-2012 issues
  • Version 2.0.11
    • Fix MISRA-2012 issues
  • Version 2.0.12
    • Fix AES Decrypt in CBC modes fail when used kLTC_DecryptKey.
  • Version 2.0.13
    • Add feature macro FSL_FEATURE_LTC_HAS_NO_CLOCK_CONTROL_BIT into LTC_Init function.
  • Version 2.0.14
    • Add feature macro FSL_FEATURE_LTC_HAS_NO_CLOCK_CONTROL_BIT into LTC_Deinit function.
  • Version 2.0.15
    • Fix MISRA-2012 issues

Function Documentation

void LTC_Init ( LTC_Type *  base)

This function initializes the LTC driver.

Parameters
baseLTC peripheral base address
void LTC_Deinit ( LTC_Type *  base)

This function deinitializes the LTC driver.

Parameters
baseLTC peripheral base address