MCUX CLNS MCUX Crypto Library Normal Secure |

Macros | Functions
McuxClPkc_Functions_UPTRT
mcuxClPkc » mcuxClPkc_Functions

mcuxClPkc functions of PKC UPTR table setup More...

## Macros
#define | MCUXCLPKC_FP_GENERATEUPTRT(pUPTRT, pBaseBuffer, bufferSize, noOfBuffer)
| Helper macro to call mcuxClPkc_GenerateUPTRT with flow protection. More...

## Functions
mcuxClPkc_Status_Protected_t | mcuxClPkc_GenerateUPTRT (uint16_t *pUPTRT, const uint8_t *pBaseBuffer, uint16_t bufferSize, uint8_t noOfBuffer)
| Initialize UPTR table. More...
mcuxClPkc_Status_Protected_t | mcuxClPkc_RandomizeUPTRT (uint16_t *pUPTRT, uint8_t noOfBuffer)
| Randomize UPTR table. More...
mcuxClPkc_Status_Protected_t | mcuxClPkc_ReRandomizeUPTRT (uint16_t *pUPTRT, uint16_t bufferSize, uint8_t noOfBuffer)
| Randomize UPTR table and operands in PKC workarea. More...

## Detailed Description

mcuxClPkc functions of PKC UPTR table setup

## Macro Definition Documentation

## ◆ MCUXCLPKC_FP_GENERATEUPTRT

#define MCUXCLPKC_FP_GENERATEUPTRT | ( |  | pUPTRT,
|  |  | pBaseBuffer,
|  |  | bufferSize,
|  |  | noOfBuffer
| ) |  |

Helper macro to call mcuxClPkc_GenerateUPTRT with flow protection.

## Function Documentation

## ◆ mcuxClPkc_GenerateUPTRT()

mcuxClPkc_Status_Protected_t mcuxClPkc_GenerateUPTRT | ( | uint16_t * | pUPTRT,
|  | const uint8_t * | pBaseBuffer,
|  | uint16_t | bufferSize,
|  | uint8_t | noOfBuffer
| ) |  |

Initialize UPTR table.

This function initializes elements in UPTR table. UPTR table contains the address (16-bit offset in PKC workarea) of each buffer (PKC operand). Each element of the table will be initialized with a 16-bit offset, associated with a buffer allocated in sequence in PKC workarea.

Parameters

  [out] | pUPTRT | pointer to the first element to be initialized in UPTR table.
  [in] | pBaseBuffer | address of the buffer in PKC workarea, with which the first element will be associated.
  [in] | bufferSize | byte length of each buffer in PKC workarea.
  [in] | noOfBuffer | number of elements to be initialized.

Returns
  A flow-protected status code (see Flow Protection API).

Return values

  MCUXCLPKC_STATUS_OK | this function always returns OK.

## ◆ mcuxClPkc_RandomizeUPTRT()

mcuxClPkc_Status_Protected_t mcuxClPkc_RandomizeUPTRT | ( | uint16_t * | pUPTRT,
|  | uint8_t | noOfBuffer
| ) |  |

Randomize UPTR table.

This function randomly permutes offsets stored in UPTR table. It randomizes the buffer allocation (physical address in PKC workarea).

Parameters

  [in,out] | pUPTRT | pointer to the first element to be randomized in UPTR table.
  [in] | noOfBuffer | number of elements to be randomized.

Returns
  A flow-protected status code (see Flow Protection API).

Return values

  MCUXCLPKC_STATUS_OK | if UPTR table is randomized successfully.
  MCUXCLPKC_STATUS_NOK | if the operation failed.

Attention
  Only the buffer allocation will be randomized, existing operands stored in each buffer will not be moved accordingly.
  This function uses PRNG. Caller needs to check if PRNG is ready.

## ◆ mcuxClPkc_ReRandomizeUPTRT()

mcuxClPkc_Status_Protected_t mcuxClPkc_ReRandomizeUPTRT | ( | uint16_t * | pUPTRT,
|  | uint16_t | bufferSize,
|  | uint8_t | noOfBuffer
| ) |  |

Randomize UPTR table and operands in PKC workarea.

This function randomly permutes offsets stored in UPTR table, together with operands stored in each buffer in PKC workarea. It randomizes the buffer allocation (physical address in PKC workarea) and moves operands stored accordingly.

Parameters

  [in,out] | pUPTRT | pointer to the first element to be randomized in UPTR table.
  [in] | bufferSize | byte length of each buffer in PKC workarea.
  [in] | noOfBuffer | number of elements to be randomized.

Returns
  A flow-protected status code (see Flow Protection API).

Return values

  MCUXCLPKC_STATUS_OK | if UPTR table is randomized successfully.
  MCUXCLPKC_STATUS_NOK | if the operation failed.

Attention
  This function uses PRNG. Caller needs to check if PRNG is ready.