Leancrypto 1.7.2
Post-Quantum Cryptographic Library
Functions
Status Information About Leancrypto

Functions

void lc_rerun_selftests (void)
 (Re-)run the self tests More...
 
void lc_rerun_one_selftest (uint64_t flag)
 (re-)run a self test for one algorithm More...
 
enum lc_alg_status_val lc_lib_alg_status (void)
 Return status information about library itself. More...
 
void lc_fips_integrity_checker (void)
 Re-run the FIPS 140 integrity test. More...
 
int lc_status (char *outbuf, size_t outlen)
 Status information about leancrypto. More...
 
enum lc_alg_status_result lc_status_get_result (uint64_t algorithm)
 Return the self test status for the algorithm. More...
 
int lc_alg_disable_selftests (void)
 Disable all algorithm startup self tests. More...
 

Detailed Description

Concept of status in leancrypto

The library maintains a status for each algorithm indicating the information given in lc_alg_status_val. For each algorithm type, a query function is provided that returns the respective inforamtion.

The status information can be obtained with the different lc_<type>_ctx_alg_status and lc_<type>_alg_status functions.

Function Documentation

◆ lc_alg_disable_selftests()

int lc_alg_disable_selftests ( void  )

Disable all algorithm startup self tests.

At runtime, before the first use of any algorithm, an algorithm-spedific self test is performed to verify that the cryptographic algorithm operates correctly. With this API call, the caller can prevent the execution of all future algorithm self tests.

This call effectively marks all self tests as passed. If a self test failed before this API call for a given algorithm, the algorithm will remain in failure mode.

Note
The caller should understand the implications of the call and only perform this call if it is truly intended.
Disabling of self tests in FIPS mode is not allowed and returns an error.
Returns
0 on success, < 0 on error

◆ lc_fips_integrity_checker()

void lc_fips_integrity_checker ( void  )

Re-run the FIPS 140 integrity test.

Note
This API is only present in the FIPS module instance of leancrypto.
Warning
In FIPS mode, this call gates all algorithms. I.e. they return an error code during initialization.

◆ lc_lib_alg_status()

enum lc_alg_status_val lc_lib_alg_status ( void  )

Return status information about library itself.

Returns
status

◆ lc_rerun_one_selftest()

void lc_rerun_one_selftest ( uint64_t  flag)

(re-)run a self test for one algorithm

Parameters
[in]flagAlgorithm reference of one of the LC_ALG_STATUS_* flagsc

◆ lc_rerun_selftests()

void lc_rerun_selftests ( void  )

(Re-)run the self tests

If the self tests were already executed for a given algorithm, they are triggered again.

This API is only allowed to be used in non-FIPS mode. This is due to the requirements of FIPS that when triggering a rerun, e.g. after a failure, all self tests have to be executed immediately instead of lazily. This is not implemented.

◆ lc_status()

int lc_status ( char *  outbuf,
size_t  outlen 
)

Status information about leancrypto.

Parameters
[in]outbufBuffer to be filled with status information, allocated by caller
[in]outlenSize of the output buffer
Returns
0 on success; < 0 on error

◆ lc_status_get_result()

enum lc_alg_status_result lc_status_get_result ( uint64_t  algorithm)

Return the self test status for the algorithm.

Parameters
[in]algorithmSpecify the algorithm(s) for which the self test status shall be returned.