trngpsx
Vitis Drivers API Documentation
Overview

Macros

#define XTRNGPSX_RESEED_TIMEOUT   1500000U
 Reseed timeout in micro-seconds. More...
 
#define XTRNGPSX_GENERATE_TIMEOUT   1500000U
 Generate timeout in micro-seconds. More...
 
#define XTRNGPSX_WORD_LEN_IN_BYTES   4U
 Word length in bytes. More...
 
#define XTRNGPSX_BYTE_LEN_IN_BITS   8U
 Byte length in bits. More...
 
#define XTRNGPSX_BLOCK_LEN_IN_BYTES   16U
 TRNG block length length in bytes. More...
 
#define XTRNGPSX_MIN_SEEDLIFE   1U
 Minimum seed life. More...
 
#define XTRNGPSX_MAX_SEEDLIFE   0x80000
 Maximum seed life 2^19. More...
 
#define XTRNGPSX_SEC_STRENGTH_IN_BURSTS   2U
 Security strength in 128-bit bursts. More...
 
#define XTRNGPSX_BURST_SIZE_IN_WORDS   4U
 Burst size in words. More...
 
#define XTRNGPSX_DF_MIN_LENGTH   2U
 Minimum DF input length. More...
 
#define XTRNGPSX_DF_MAX_LENGTH   0x1FU
 Maximum DF input length. More...
 
#define XTRNGPSX_DF_NUM_OF_BYTES_BEFORE_MIN_700CLKS_WAIT   8U
 Number of bytes to be written before wait. More...
 
#define XTRNGPSX_ADAPTPROPTESTCUTOFF_MAX_VAL   0x3FFU
 maximum adaptprpptest cutoff value More...
 
#define XTRNGPSX_REPCOUNTTESTCUTOFF_MAX_VAL   0x1FFU
 maximum repcounttest cutoff value More...
 
#define XTRNGPSX_DEFAULT_SEED_LIFE   256U
 Default seed life. More...
 
#define XTRNGPSX_PERS_STRING_LEN_IN_WORDS   12U
 Personalization string length in words. More...
 
#define XTRNGPSX_PERS_STRING_LEN_IN_BYTES   48U
 Personalization string length in bytes. More...
 
#define XTRNGPSX_SEC_STRENGTH_IN_BYTES   32U
 security strength in Bytes More...
 
#define TRNG_STATUS   (0x00000004U)
 Register: TRNG_STATUS. More...
 
#define TRNG_CTRL   (0x00000008U)
 Register: TRNG_CTRL. More...
 
#define TRNG_CTRL_2   (0x0000000CU)
 Register: TRNG_CTRL_2. More...
 
#define TRNG_CTRL_3   (0x00000010U)
 Register: TRNG_CTRL_3. More...
 
#define TRNG_CTRL_4   (0x00000014U)
 Register: TRNG_CTRL_4. More...
 
#define TRNG_PER_STRNG_11   (0x000000ACU)
 Register: TRNG_PER_STRNG_11. More...
 
#define TRNG_CORE_OUTPUT   (0x000000C0U)
 Register: TRNG_CORE_OUTPUT. More...
 
#define TRNG_RESET   (0x000000D0U)
 Register: TRNG_RESET. More...
 
#define TRNG_OSC_EN   (0x000000D4U)
 Register: TRNG_OSC_EN. More...
 

Enumerations

enum  XTrngpsx_ErrorState {
  XTRNGPSX_UNHEALTHY = 1, XTRNGPSX_HEALTHY, XTRNGPSX_CATASTROPHIC, XTRNGPSX_ERROR,
  XTRNGPSX_STARTUP_TEST
}
 
enum  XTrngpsx_State { XTRNGPSX_UNINITIALIZED_STATE = 1, XTRNGPSX_INSTANTIATE_STATE, XTRNGPSX_RESEED_STATE, XTRNGPSX_GENERATE_STATE }
 
enum  XTrngpsx_ErrorCodes {
  XTRNGPSX_INVALID_PARAM = 0x0, XTRNGPSX_INVALID_MODE, XTRNGPSX_INVALID_DF_LENGTH, XTRNGPSX_INVALID_SEED_LIFE,
  XTRNGPSX_INVALID_SEED_VALUE, XTRNGPSX_INVALID_SEED_LENGTH, XTRNGPSX_INVALID_STATE, XTRNGPSX_INVALID_ADAPTPROPTEST_CUTOFF_VALUE,
  XTRNGPSX_INVALID_REPCOUNTTEST_CUTOFF_VALUE, XTRNGPSX_USER_CFG_COPY_ERROR, XTRNGPSX_UNHEALTHY_STATE, XTRNGPSX_INVALID_BUF_SIZE,
  XTRNGPSX_RESEED_REQUIRED_ERROR, XTRNG_PSX_INVALID_PREDRES_VALUE, XTRNGPSX_MEMSET_UNINSTANTIATE_ERROR, XTRNGPSX_TIMEOUT_ERROR,
  XTRNGPSX_CATASTROPHIC_CTF_ERROR, XTRNGPSX_CATASTROPHIC_DTF_ERROR, XTRNGPSX_KAT_FAILED_ERROR, XTRNGPSX_WRITE_ERROR,
  XTRNGPSX_INVALID_BLOCKING_MODE
}
 

Functions

int XTrngpsx_CfgInitialize (XTrngpsx_Instance *InstancePtr, const XTrngpsx_Config *CfgPtr, UINTPTR EffectiveAddr)
 This function initializes the TRNGPSV instance/driver. More...
 
int XTrngpsx_Instantiate (XTrngpsx_Instance *InstancePtr, const u8 *Seed, u32 SeedLength, const u8 *PersStr, const XTrngpsx_UserConfig *UserCfg)
 This function instantiates the TRNG instance with user configure values. More...
 
int XTrngpsx_Reseed (XTrngpsx_Instance *InstancePtr, const u8 *Seed, u8 DLen)
 This function triggers and reseeds the DRBG module. More...
 
int XTrngpsx_Generate (XTrngpsx_Instance *InstancePtr, u8 *RandBuf, u32 RandBufSize, u8 PredResistance)
 This function generates and collects random data in to a buffer. More...
 
int XTrngpsx_Uninstantiate (XTrngpsx_Instance *InstancePtr)
 This function uninstantiates the TRNG instance. More...
 
XTrngpsx_Config * XTrngpsx_LookupConfig (u16 DeviceId)
 This function returns a reference to an XTrngpsx_Config structure based on the DeviceId. More...
 
int XTrngpsx_DRBGKat (XTrngpsx_Instance *InstancePtr)
 This function runs DRBG self test i.e DRBG full cycle Instantiate+Reseed, Reseed and Generate. More...
 
int XTrngpsx_HealthTest (XTrngpsx_Instance *InstancePtr)
 This function runs health tests. More...
 
int XTrngpsx_PreOperationalSelfTests (XTrngpsx_Instance *InstancePtr)
 This function runs preoperational self tests and updates TRNG error state. More...
 

Constant definitions for parameters used for Health and KAT tests

#define XTRNGPSX_KAT_DEFAULT_DF_lENGTH   7U
 Constant definitions for Health and KAT tests. More...
 
#define XTRNGPSX_KAT_DEFAULT_SEED_LIFE   2U
 Seed life. More...
 
#define XTRNGPSX_KAT_SEED_LEN_IN_BYTES   128U
 Seed length in bytes. More...
 

Macro Definition Documentation

#define TRNG_CORE_OUTPUT   (0x000000C0U)

Register: TRNG_CORE_OUTPUT.

#define TRNG_CTRL   (0x00000008U)

Register: TRNG_CTRL.

Referenced by XTrngpsx_Generate().

#define TRNG_CTRL_2   (0x0000000CU)

Register: TRNG_CTRL_2.

#define TRNG_CTRL_3   (0x00000010U)

Register: TRNG_CTRL_3.

#define TRNG_CTRL_4   (0x00000014U)

Register: TRNG_CTRL_4.

#define TRNG_OSC_EN   (0x000000D4U)

Register: TRNG_OSC_EN.

Referenced by XTrngpsx_Generate(), and XTrngpsx_Uninstantiate().

#define TRNG_PER_STRNG_11   (0x000000ACU)

Register: TRNG_PER_STRNG_11.

#define TRNG_RESET   (0x000000D0U)

Register: TRNG_RESET.

#define TRNG_STATUS   (0x00000004U)

Register: TRNG_STATUS.

#define XTRNGPSX_ADAPTPROPTESTCUTOFF_MAX_VAL   0x3FFU

maximum adaptprpptest cutoff value

Referenced by XTrngpsx_Instantiate().

#define XTRNGPSX_BLOCK_LEN_IN_BYTES   16U

TRNG block length length in bytes.

Referenced by XTrngpsx_Instantiate().

#define XTRNGPSX_BURST_SIZE_IN_WORDS   4U

Burst size in words.

#define XTRNGPSX_BYTE_LEN_IN_BITS   8U

Byte length in bits.

#define XTRNGPSX_DEFAULT_SEED_LIFE   256U

Default seed life.

#define XTRNGPSX_DF_MAX_LENGTH   0x1FU

Maximum DF input length.

Referenced by XTrngpsx_Instantiate(), and XTrngpsx_Reseed().

#define XTRNGPSX_DF_MIN_LENGTH   2U

Minimum DF input length.

Referenced by XTrngpsx_Instantiate(), and XTrngpsx_Reseed().

#define XTRNGPSX_DF_NUM_OF_BYTES_BEFORE_MIN_700CLKS_WAIT   8U

Number of bytes to be written before wait.

#define XTRNGPSX_GENERATE_TIMEOUT   1500000U

Generate timeout in micro-seconds.

#define XTRNGPSX_KAT_DEFAULT_DF_lENGTH   7U

Constant definitions for Health and KAT tests.

DF length

Referenced by XTrngpsx_DRBGKat().

#define XTRNGPSX_KAT_DEFAULT_SEED_LIFE   2U

Seed life.

Referenced by XTrngpsx_DRBGKat().

#define XTRNGPSX_KAT_SEED_LEN_IN_BYTES   128U

Seed length in bytes.

Referenced by XTrngpsx_DRBGKat().

#define XTRNGPSX_MAX_SEEDLIFE   0x80000

Maximum seed life 2^19.

Referenced by XTrngpsx_Instantiate().

#define XTRNGPSX_MIN_SEEDLIFE   1U

Minimum seed life.

Referenced by XTrngpsx_Instantiate().

#define XTRNGPSX_PERS_STRING_LEN_IN_BYTES   48U

Personalization string length in bytes.

Referenced by XTrngpsx_DRBGKat().

#define XTRNGPSX_PERS_STRING_LEN_IN_WORDS   12U

Personalization string length in words.

#define XTRNGPSX_REPCOUNTTESTCUTOFF_MAX_VAL   0x1FFU

maximum repcounttest cutoff value

Referenced by XTrngpsx_Instantiate().

#define XTRNGPSX_RESEED_TIMEOUT   1500000U

Reseed timeout in micro-seconds.

#define XTRNGPSX_SEC_STRENGTH_IN_BURSTS   2U

Security strength in 128-bit bursts.

#define XTRNGPSX_SEC_STRENGTH_IN_BYTES   32U

security strength in Bytes

Referenced by XTrngpsx_DRBGKat(), and XTrngpsx_Generate().

#define XTRNGPSX_WORD_LEN_IN_BYTES   4U

Word length in bytes.

Referenced by XTrngpsx_Generate().

Enumeration Type Documentation

Enumerator
XTRNGPSX_INVALID_PARAM 

0x0 - Invalid argument

XTRNGPSX_INVALID_MODE 

0x1 - Error when TRNG operation mode is invalid

XTRNGPSX_INVALID_DF_LENGTH 

0x2 - Error when DF length is invalid

XTRNGPSX_INVALID_SEED_LIFE 

0x3 - Error when seed life is invalid

XTRNGPSX_INVALID_SEED_VALUE 

0x4 - Error when seed is NULL

XTRNGPSX_INVALID_SEED_LENGTH 

0x5 - Error when input seed length doesn't match with df length

XTRNGPSX_INVALID_STATE 

0x6 - Error when TRNG state is invalid

XTRNGPSX_INVALID_ADAPTPROPTEST_CUTOFF_VALUE 

0x7 - Invalid adaptive proptest cutoff value

XTRNGPSX_INVALID_REPCOUNTTEST_CUTOFF_VALUE 

0x8 - Invalid repitive count test cutoff value

XTRNGPSX_USER_CFG_COPY_ERROR 

0x9 - Error during memcpy of UserConfig structure

XTRNGPSX_UNHEALTHY_STATE 

0xA - Error when device fails KAT or health tests

XTRNGPSX_INVALID_BUF_SIZE 

0xB - Error invalid buffer size

XTRNGPSX_RESEED_REQUIRED_ERROR 

0xC - Error seed life expired and reseed required in DRBG mode

XTRNG_PSX_INVALID_PREDRES_VALUE 

0xD - Invalid predication resistance valye

XTRNGPSX_MEMSET_UNINSTANTIATE_ERROR 

0xE - Error during memset

XTRNGPSX_TIMEOUT_ERROR 

0xF - Timeout while waiting for done bit during reseed or generate

XTRNGPSX_CATASTROPHIC_CTF_ERROR 

0x10 - CTF error during reseed

XTRNGPSX_CATASTROPHIC_DTF_ERROR 

0x11 - DTF error during generate

XTRNGPSX_KAT_FAILED_ERROR 

0x12 - Error when resultant TRNG o/p doesn't match with expected o/p

XTRNGPSX_WRITE_ERROR 

0x13 - Error occurred while writing in to the register

XTRNGPSX_INVALID_BLOCKING_MODE 

0x14 - Error occurred when invalid blocking mode is selected

Enumerator
XTRNGPSX_UNHEALTHY 

unhealthy state

XTRNGPSX_HEALTHY 

healthy state

XTRNGPSX_CATASTROPHIC 

catastropic state

XTRNGPSX_ERROR 

error state

XTRNGPSX_STARTUP_TEST 

startup test

Enumerator
XTRNGPSX_UNINITIALIZED_STATE 

Default state.

XTRNGPSX_INSTANTIATE_STATE 

Instantiate state.

XTRNGPSX_RESEED_STATE 

Reseed state.

XTRNGPSX_GENERATE_STATE 

Generate state.

Function Documentation

int XTrngpsx_CfgInitialize ( XTrngpsx_Instance *  InstancePtr,
const XTrngpsx_Config *  CfgPtr,
UINTPTR  EffectiveAddr 
)

This function initializes the TRNGPSV instance/driver.

This function must be called prior to using the driver. Initialization includes only setting up the device id and base address. All the remaining parameters of the Instance will be initialized in Instantiate function.

Parameters
InstancePtris a pointer to the XTrngpsx instance.
CfgPtrpoints to the configuration structure associated with the TRNGPSX driver.
EffectiveAddris the base address of the device. If address translation is being used, then this parameter must reflect the virtual base address. Otherwise, the physical address should be used.
Returns
  • XST_SUCCESS if initialization was successful.
  • XTRNGPSX_INVALID_PARAM if invalid parameter passed to this function.

References XTRNGPSX_ERROR, XTRNGPSX_INVALID_PARAM, and XTRNGPSX_UNINITIALIZED_STATE.

int XTrngpsx_DRBGKat ( XTrngpsx_Instance *  InstancePtr)

This function runs DRBG self test i.e DRBG full cycle Instantiate+Reseed, Reseed and Generate.

Parameters
InstancePtrPointer to XTrngpsx_Instance.
Returns
  • XST_SUCCESS On success
  • Error Code On failure

References XTrngpsx_Generate(), XTrngpsx_Instantiate(), XTRNGPSX_KAT_DEFAULT_DF_lENGTH, XTRNGPSX_KAT_DEFAULT_SEED_LIFE, XTRNGPSX_KAT_FAILED_ERROR, XTRNGPSX_KAT_SEED_LEN_IN_BYTES, XTRNGPSX_PERS_STRING_LEN_IN_BYTES, XTrngpsx_Reseed(), XTRNGPSX_SEC_STRENGTH_IN_BYTES, and XTrngpsx_Uninstantiate().

Referenced by XTrngpsx_PreOperationalSelfTests().

int XTrngpsx_Generate ( XTrngpsx_Instance *  InstancePtr,
u8 *  RandBuf,
u32  RandBufSize,
u8  PredResistance 
)

This function generates and collects random data in to a buffer.

Parameters
InstancePtrPointer to XTrngpsx_Instance
RandBufPointer to buffer in which random data is stored.
RandBufSizeSize of the buffer in which random data is stored.
PredResistanceis the flag that controls Generate level Prediction Resistance. When enabled, it mandates fresh seed for every Generate operation.
Returns
  • XST_SUCCESS On successful generate of random number
  • XTRNGPSX_INVALID_PARAM If invalid parameter(s) passed to this function.
  • XTRNGPSX_INVALID_STATE If state is not sequenced correctly
  • XTRNGPSX_INVALID_MODE If invalid mode is passed to this function
  • XTRNGPSX_INVALID_BUF_SIZE If buffer is less that 256 bytes or NULL
  • XTRNG_PSX_INVALID_PREDRES_VALUE If invalid predication resistance value is passed to this function
    • XTRNGPSX_UNHEALTHY_STATE If TRNG is in failure state, needs an uninstantiation or KAT should be run if error is catastrophic
    • XTRNGPSX_RESEED_REQUIRED_ERROR If elapsed seed life exceeds the requested seed life in DRBG mode

XTRNGPSX_TIMEOUT_ERROR If timeout occurred waiting for QCNT to become 4.

  • XTRNGPSX_CATASTROPHIC_DTF_ERROR If DTF bit asserted in STATUS register.
  • XTRNGPSX_ERROR_WRITE On write failure
    • XST_FAILURE On unexpected failure

References TRNG_CTRL, TRNG_OSC_EN, XTRNG_PSX_INVALID_PREDRES_VALUE, XTRNGPSX_CATASTROPHIC, XTRNGPSX_ERROR, XTRNGPSX_GENERATE_STATE, XTRNGPSX_HEALTHY, XTRNGPSX_INSTANTIATE_STATE, XTRNGPSX_INVALID_BUF_SIZE, XTRNGPSX_INVALID_MODE, XTRNGPSX_INVALID_PARAM, XTRNGPSX_INVALID_STATE, XTrngpsx_Reseed(), XTRNGPSX_RESEED_REQUIRED_ERROR, XTRNGPSX_RESEED_STATE, XTRNGPSX_SEC_STRENGTH_IN_BYTES, XTRNGPSX_STARTUP_TEST, XTRNGPSX_UNHEALTHY_STATE, and XTRNGPSX_WORD_LEN_IN_BYTES.

Referenced by XTrngpsx_DRBGKat().

int XTrngpsx_HealthTest ( XTrngpsx_Instance *  InstancePtr)

This function runs health tests.

Parameters
InstancePtrPointer to XTrngpsx_Instance.
Returns
  • XST_SUCCESS On success
  • Error Code On failure

References XTrngpsx_Instantiate(), and XTrngpsx_Uninstantiate().

Referenced by XTrngpsx_PreOperationalSelfTests().

int XTrngpsx_Instantiate ( XTrngpsx_Instance *  InstancePtr,
const u8 *  Seed,
u32  SeedLength,
const u8 *  PersStr,
const XTrngpsx_UserConfig *  UserCfg 
)

This function instantiates the TRNG instance with user configure values.

Parameters
InstancePtrPointer to the XTrngpsx_Instance.
SeedPointer to the seed input
SeedLengthSeed length in bytes
PersStrPointer to the personalization string input
UserCfgPointer to the XTrngpsx_UserConfig
Returns
  • XST_SUCCESS On successful instantation
  • XTRNGPSX_INVALID_PARAM If invalid parameter(s) passed to this function.
  • XTRNGPSX_INVALID_SEED_VALUE If provide seed is NULL in DRBG mode
  • XTRNGPSX_INVALID_STATE If state is not in uninstantiate state
  • XTRNGPSX_UNHEALTHY_STATE If TRNG KAT fails
  • XTRNGPSX_INVALID_MODE If invalid mode is passed to this function
  • XTRNGPSX_INVALID_DF_LENGTH If invalid DF input length is passed as a function
  • XTRNGPSX_INVALID_SEED_LENGTH If provide seed length doesn't match with given DF length
  • XTRNGPSX_INVALID_SEED_LIFE If invalid seed life is provided
  • XTRNGPSX_INVALID_ADAPTPROPTEST_CUTOFF_VALUE If invalid cutoff value is provided
  • XTRNGPSX_INVALID_REPCOUNTTEST_CUTOFF_VALUE If invalid repetitive test cutoff value is provided
  • XTRNGPSX_USER_CFG_COPY_ERROR If error occurred during copy of XTrngpsx_UserConfig structure
  • XTRNGPSX_TIMEOUT_ERROR If timeout occurred waiting for done bit
  • XTRNGPSX_CATASTROPHIC_CTF_ERROR If CTF bit asserted in STATUS register.
  • XTRNGPSX_ERROR_WRITE On write failure
  • XTRNGPSX_INVALID_BLOCKING_MODE If invalid blocking mode is choosen
  • XST_FAILURE On unexpected failure

References XTRNGPSX_ADAPTPROPTESTCUTOFF_MAX_VAL, XTRNGPSX_BLOCK_LEN_IN_BYTES, XTRNGPSX_CATASTROPHIC, XTRNGPSX_DF_MAX_LENGTH, XTRNGPSX_DF_MIN_LENGTH, XTRNGPSX_ERROR, XTRNGPSX_HEALTHY, XTRNGPSX_INSTANTIATE_STATE, XTRNGPSX_INVALID_ADAPTPROPTEST_CUTOFF_VALUE, XTRNGPSX_INVALID_BLOCKING_MODE, XTRNGPSX_INVALID_DF_LENGTH, XTRNGPSX_INVALID_MODE, XTRNGPSX_INVALID_PARAM, XTRNGPSX_INVALID_REPCOUNTTEST_CUTOFF_VALUE, XTRNGPSX_INVALID_SEED_LENGTH, XTRNGPSX_INVALID_SEED_LIFE, XTRNGPSX_INVALID_SEED_VALUE, XTRNGPSX_INVALID_STATE, XTRNGPSX_MAX_SEEDLIFE, XTRNGPSX_MIN_SEEDLIFE, XTRNGPSX_REPCOUNTTESTCUTOFF_MAX_VAL, XTRNGPSX_UNINITIALIZED_STATE, and XTRNGPSX_USER_CFG_COPY_ERROR.

Referenced by XTrngpsx_DRBGKat(), and XTrngpsx_HealthTest().

XTrngpsx_Config * XTrngpsx_LookupConfig ( u16  DeviceId)

This function returns a reference to an XTrngpsx_Config structure based on the DeviceId.

The return value will refer to an entry in the device configuration table defined in the xtrngpsx_g.c file.

Parameters
DeviceIdis the unique device ID of the device being lookedup.
Returns
XTrngpsx_LookupConfig returns a reference to a config record in the configuration table (in xtrngpsx.c) corresponding to DeviceId, or NULL if no match is found.
int XTrngpsx_PreOperationalSelfTests ( XTrngpsx_Instance *  InstancePtr)

This function runs preoperational self tests and updates TRNG error state.

Parameters
InstancePtrPointer to XTrngpsx_Instance.
Returns
  • XST_SUCCESS On success
  • Error Code On failure

References XTrngpsx_DRBGKat(), XTrngpsx_HealthTest(), and XTrngpsx_Uninstantiate().

int XTrngpsx_Reseed ( XTrngpsx_Instance *  InstancePtr,
const u8 *  Seed,
u8  DLen 
)

This function triggers and reseeds the DRBG module.

Parameters
InstancePtrPointer to XTrngpsx_Instance.
SeedPointer to the seed input
DLenSeed length in TRNG block size
Returns
  • XST_SUCCESS On successful reseed
  • XTRNGPSX_INVALID_PARAM If invalid parameter(s) passed to this function.
  • XTRNGPSX_INVALID_SEED_VALUE If provide seed is NULL in DRBG/HRNG mode
  • XTRNGPSX_INVALID_MODE If invalid mode is passed to this function
  • XTRNGPSX_INVALID_DF_LENGTH If invalid DF input length is passed as a function
  • XTRNGPSX_INVALID_STATE If state is not sequenced correctly
  • XTRNGPSX_UNHEALTHY_STATE If TRNG is in failure state, needs an uninstantiation or KAT should be run if the error is catastrophic
  • XTRNGPSX_TIMEOUT_ERROR If timeout occurred waiting for done bit
  • XTRNGPSX_CATASTROPHIC_CTF_ERROR If CTF bit asserted in STATUS register.
  • XTRNGPSX_ERROR_WRITE On write failure
    • XST_FAILURE On unexpected failure

References XTRNGPSX_DF_MAX_LENGTH, XTRNGPSX_DF_MIN_LENGTH, XTRNGPSX_HEALTHY, XTRNGPSX_INVALID_DF_LENGTH, XTRNGPSX_INVALID_MODE, XTRNGPSX_INVALID_PARAM, XTRNGPSX_INVALID_SEED_VALUE, XTRNGPSX_INVALID_STATE, XTRNGPSX_RESEED_STATE, XTRNGPSX_STARTUP_TEST, XTRNGPSX_UNHEALTHY_STATE, and XTRNGPSX_UNINITIALIZED_STATE.

Referenced by XTrngpsx_DRBGKat(), and XTrngpsx_Generate().

int XTrngpsx_Uninstantiate ( XTrngpsx_Instance *  InstancePtr)

This function uninstantiates the TRNG instance.

Parameters
InstancePtrPointer to XTrngpsx_Instance.
Returns
  • XST_SUCCESS if uninstantiation was successful.
  • XTRNGPSX_INVALID_PARAM if invalid instance is passed to function
  • XTRNGPSX_ERROR_MEMSET_UNINSTANTIATE_ERROR if memset was not successful
    • XST_FAILURE On unexpected failure

References TRNG_OSC_EN, XTRNGPSX_INVALID_PARAM, and XTRNGPSX_UNINITIALIZED_STATE.

Referenced by XTrngpsx_DRBGKat(), XTrngpsx_HealthTest(), and XTrngpsx_PreOperationalSelfTests().