37.3.4.1 SelfTest

Purpose

This service is used to initialize the PUKCL. It resets the PUKCC, clears the Crypto RAM, and returns the library and PUKCC version numbers.

It must be called before using any other services in the library and the user must verify the return status at the end of the service execution.

How to Use the Service

Description

This service processes internal tests and returns information and status codes as described in  Status Returned Values. The service name for this operation is SelfTest.

Parameters Definition

It is possible to directly address this service through the PUKCL_SelfTest() macro.

Table 37-5. SelfTest Service Parameters
Parameter Type Dir. Location Data Length Before Executing the Service After Executing the Service
u4Version u4 O PUKCL version
u4PUKCCVersion u4 O PUKCC Version
u4CheckNum1 u4 O Test result value 1
u4CheckNum2 u4 O Test result value 2
u1Step u1 O Latest correctly executed step

Code Example

PUKCL_PARAM PUKCLParam;
PPUKCL_PARAM pvPUKCLParam = &PUKCLParam;

// vPUKCL_Process() is a macro command, which populates the service name
// and then calls the library
vPUKCL_Process(SelfTest,pvPUKCLParam);

if (PUKCL(u2Status) == PUKCL_OK)
            {
            // The Library version is available
            // in PUKCL_SelfTest(u4Version)
            // The PUKCL version is available
            // in PUKCL_SelfTest(u4PUKCCVersion)
            }

Returned Values

The expected u4Version value depends on the version of PUKCL being used, and the u4PUKCCVersion value depends on the version of PUKCC being used.

The expected u4CheckNum1 value is 0x6e70ddd2 and the expected one for u4CheckNum2 is 0x25c8d64f. The expected final u1Step value is 3.

Status Returned Values

Table 37-6. SelfTest Service Return Codes
Returned Status Importance Meaning
PUKCL_OK Service functioned correctly.
PUKCL_ERROR Severe An issue has been encountered.