NXP NFC Reader Library v4.040.05.011646

Modules | Functions
CryptoRng
Common

This is only a wrapper layer to abstract the different crypto random number generator implementations. More...

Collaboration diagram for CryptoRng:

## Modules
| Component : Software
| Software implementation of the phCryptoRng interface.

## Functions
phStatus_t | phCryptoRng_Seed (void *pDataParams, uint8_t *bSeed, uint8_t bSeedLength)
| Seeds the random number generator with the given seed. More...
phStatus_t | phCryptoRng_Rnd (void *pDataParams, uint16_t wNoOfRndBytes, uint8_t *pRnd)
| Obtains random bytes from the random source. More...

## Detailed Description

This is only a wrapper layer to abstract the different crypto random number generator implementations.

With this wrapper it is possible to support more than one crypto random number generator implementation in parallel, by adapting this wrapper.

Important hints for users of this component:

- Before use of any function, the dedicated rng implementation has to be initialized (e.g. phCryptoRng_Sw_Init)
- Before random numbers can be generated, the phCryptoRng_Seed function has to be called

## Function Documentation

## § phCryptoRng_Seed()

phStatus_t phCryptoRng_Seed | ( | void * | pDataParams,
|  | uint8_t * | bSeed,
|  | uint8_t | bSeedLength
| ) |  |

Seeds the random number generator with the given seed.

The seed length is dependend on the underlaying implementation. Further details can be found in the detailed description of the underlying layers.

Returns
  Status code

Return values

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

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bSeed | Seed
  [in] | bSeedLength | Size of the seed.

## § phCryptoRng_Rnd()

phStatus_t phCryptoRng_Rnd | ( | void * | pDataParams,
|  | uint16_t | wNoOfRndBytes,
|  | uint8_t * | pRnd
| ) |  |

Obtains random bytes from the random source.

Returns
  Status code

Return values

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

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | wNoOfRndBytes | number of random bytes to generate
  [out] | pRnd | generated bytes; uint8_t[dwNumBytes]