NXP NFC Reader Library v4.040.05.011646

Data Structures | Macros | Functions
Component : Software
Common » CryptoRng

Software implementation of the phCryptoRng interface. More...

Collaboration diagram for Component : Software:

## Data Structures
struct | phCryptoRng_Sw_DataParams_t
| Software parameter structure. More...

## Macros
#define | PH_CRYPTORNG_SW_ID 0x01
| ID for Software crypto rng component. More...

## Functions
phStatus_t | phCryptoRng_Sw_Init (phCryptoRng_Sw_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, void *pCryptoDataParams)
| Initialise the CryptoRnd component. More...

## Detailed Description

Software implementation of the phCryptoRng interface.

The following standard is implemented:

- NIST Special Publication 800-90: CTR_DRBG

Architecture overview of the phCryptoRng_Sw Component

- The AES 128 implementation of the phCryptoSym component is used to generate random numbers.
- This phCryptoSym instance has to be properly instantiated before generation of random numbers is possible.
- The phCryptoRng_Sw_Int block implements all functions required by the NIST standard.
- According to the state of the library component, the seed function choses whether to use #phCryptoRng_Sw_Instantiate or #phCryptoRng_Sw_Reseed.
- #phCryptoRng_Sw_Update is automatically called when random numbers are generated in order to be ready for retrieving the next chunk of random bytes.
- #phCryptoRng_Sw_BlockCipherDf is used to derive the key and V-value for a given seed.

## Macro Definition Documentation

## § PH_CRYPTORNG_SW_ID

#define PH_CRYPTORNG_SW_ID 0x01

ID for Software crypto rng component.

## Function Documentation

## § phCryptoRng_Sw_Init()

phStatus_t phCryptoRng_Sw_Init | ( | phCryptoRng_Sw_DataParams_t * | pDataParams,
|  | uint16_t | wSizeOfDataParams,
|  | void * | pCryptoDataParams
| ) |  |

Initialise the CryptoRnd component.

For seeding, the following considerations have to be taken:

- Take a seed of at 32 bytes, which consists of
  - entropy input
  - nonce
  - personalization string.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layers parameter structure.
  [in] | wSizeOfDataParams | Specifies the size of the data parameter structure.
  [in] | pCryptoDataParams | Pointer to the parameter structure of the symmetric crypto layer.