37.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 37-1. Return Code Status Decoding

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

Table 37-3. Severity Indicators
Value for Bits 14–15 Severity Comment
0xC000 Severe Indicates a blocking error condition
0x8000 Warning Indicates a cautionary use of the return values
0x4000 Information Indicates the result is correct and gives information
0x0000 No error or no severity given

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

Table 37-4. Return Codes
Value for Bits 00–13 Severity Code Reason Code
0x0000 PUKCL_OK
0x4001 Informative PUKCL_NUMBER_IS_NOT_PRIME
0x4002 Informative PUKCL_NUMBER_IS_PRIME
0xC001 Severe PUKCL_COMPUTATION_NOT_STARTED
0xC002 Severe PUKCL_UNKNOWN_SERVICE
0xC003 Severe PUKCL_UNEXPLOITABLE_OPTIONS
0xC004 Severe PUKCL_HARDWARE_ISSUE
0xC005 Severe PUKCL_WRONG_HARDWARE
0xC006 Severe PUKCL_LIBRARY_MALFORMED
0xC007 Severe PUKCL_ERROR
0xC008 Severe PUKCL_UNKNOWN_SUBSERVICE
0xC101 Severe PUKCL_DIVISION_BY_ZERO
0xC102 Severe PUKCL_MALFORMED_MODULUS
0xC103 Severe PUKCL_FAULT_DETECTED
0xC104 Severe PUKCL_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 must not be used.
  • A status value indicating a warning must 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.