43.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 43-5. SelfTest Service Parameters
ParameterTypeDir.LocationData LengthBefore Executing the ServiceAfter Executing the Service
u4Versionu4OPUKCL version
u4PUKCCVersionu4OPUKCC Version
u4CheckNum1u4OTest result value 1
u4CheckNum2u4OTest result value 2
u1Stepu1OLatest 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 43-6. SelfTest Service Return Codes
Returned StatusImportanceMeaning
PUKCL_OKService functioned correctly.
PUKCL_ERRORSevereAn issue has been encountered.