43.3.3.6 Return Codes

Each call to one of the PUKCL services returns a status code indicating whether or not the execution is correct, which can be decoded, as shown in the following figure.

Figure 43-1. Return Code Status Decoding

The following table shows how the severity indicators should be decoded.

Table 43-3. Severity Indicators
Value for Bits 14–15SeverityComment
0xC000SevereIndicates a blocking error condition
0x8000WarningIndicates a cautionary use of the return values
0x4000InformationIndicates the result is correct and gives information
0x0000No error or no severity given

The following table contains the exhaustive list of all reason codes.

Table 43-4. Return Codes
Value for Bits 00–13Severity CodeReason Code
0x0000PUKCL_OK
0x4001InformativePUKCL_NUMBER_IS_NOT_PRIME
0x4002InformativePUKCL_NUMBER_IS_PRIME
0xC001SeverePUKCL_COMPUTATION_NOT_STARTED
0xC002SeverePUKCL_UNKNOWN_SERVICE
0xC003SeverePUKCL_UNEXPLOITABLE_OPTIONS
0xC004SeverePUKCL_HARDWARE_ISSUE
0xC005SeverePUKCL_WRONG_HARDWARE
0xC006SeverePUKCL_LIBRARY_MALFORMED
0xC007SeverePUKCL_ERROR
0xC008SeverePUKCL_UNKNOWN_SUBSERVICE
0xC101SeverePUKCL_DIVISION_BY_ZERO
0xC102SeverePUKCL_MALFORMED_MODULUS
0xC103SeverePUKCL_FAULT_DETECTED
0xC104SeverePUKCL_MALFORMED_KEY

Please note the following rules about return codes:

  • A status value indicating a severe error, means that an expected operation has not been executed or has been corrupted. Therefore, the result of such an operation should never be used.
  • A status value indicating a warning should be looked at precisely, as the expected correctness of the result cannot be guaranteed.
  • A status value indicating an information always means that the result is correct with no possible misinterpretation of the values.
  • A status value zero indicates that there is no error or no severity.

In the following sections, for each service, the constraints on the parameters placement are detailed. For reduced code size and higher execution speed, tests are processed on these constraints. It is important that PUKCL users take these placement constraints into consideration at the development and test stages to ensure the correct functioning of the library.