General support functions

General support functions comprise the following APIs:

  • Functions to open or close the crypto adapter. It is recommended to open the crypto adapter before using any of the libica crypto functions, and to close it after the last usage of the libica crypto functions. A valid adapter handle as input is explicitly required only for certain RSA-related and ECC-support functions.

    A pointer to the value DRIVER_NOT_LOADED indicates an invalid adapter handle. The parameter ica_adapter_handle_t is a redefine of int.

  • If libica is built with software fallbacks enabled, a function is available to enable or disable software fallbacks using OpenSSL. With fallbacks enabled, libica attempts to perform requests by calling OpenSSL functions, if there is either no hardware support available or if the hardware returned an error.

    By default, the fallback mode is disabled for libica. In FIPS mode, OpenSSL only supports a small subset of elliptic curves.

  • A function to enable or disable the offloading of cryptographic operations to cryptographic coprocessors. By default, offloading is disabled and libica processes cryptographic operations on CPACF instead of cryptographic coprocessors if functionality is available on both.

    You can also set the environment variable LIBICA_OFFLOAD_MODE to an integer not equal to zero to always prefer offloading to cryptographic coprocessors, if applicable.

  • A function to enable or disable the counting of cryptographic operations. By default, libica counts its cryptographic operations in shared memory.

    You can also set the environment variable LIBICA_STATS_MODE to zero to disable the counting of cryptographic operations.

These functions are declared in: include/ica_api.h.