![]() |
PQLR
Postquantum Crypto Library by QAPP
|
Macros | |
#define | PQLR_ALG_OPTION_ENABLE_HW_ACC 0x00000001u |
#define | PQLR_ALG_OPTION_ENABLE_PROXY 0x00000002u |
Typedefs | |
typedef struct pqlr_alg_st * | pqlr_alg |
PQLR algorithm instance handle. More... | |
Functions | |
PQLR_API pqlr_alg | pqlr_alg_new (const char *alg_str) |
Creates pqlr_alg instance. More... | |
PQLR_API void | pqlr_alg_free (pqlr_alg alg) |
Frees pqlr_alg instance and all corresponding resources. More... | |
PQLR_API const char * | pqlr_alg_get_str (const pqlr_alg alg) |
Gets a string with the name of PQLR algorithm. More... | |
PQLR_API int | pqlr_alg_num_paramsets (const pqlr_alg alg) |
Gets available parameter sets for this algorithm. If the return value is n then all parameter sets from range [0; n) can be used. More... | |
PQLR_API int | pqlr_alg_get_paramset (const pqlr_alg alg) |
Gets parameter set configured for given algorithm instance. More... | |
PQLR_API int | pqlr_alg_set_paramset (pqlr_alg alg, int paramset) |
Enables selected parameter set. More... | |
PQLR_API const char * | pqlr_alg_get_paramset_str_from_id (const pqlr_alg alg, int paramset) |
Gets parameter set string for given algorithm and id. More... | |
PQLR_API int | pqlr_alg_get_paramset_id_from_str (const pqlr_alg alg, const char *paramset_str) |
Gets parameter set id for given algorithm and paramset string. More... | |
PQLR_API size_t | pqlr_alg_get_paramset_strs (const pqlr_alg alg, const char **paramsets, size_t count) |
Fills the provided buffer with names of available parameter sets for given algorithm. More... | |
PQLR_API int | pqlr_alg_set_options (pqlr_alg alg, uint32_t options) |
Enables selected option. More... | |
PQLR_API void | pqlr_alg_set_defaults (pqlr_alg alg) |
Configures the PQLR algorithm with default parameter and options set. More... | |
In order to use any PQLR common algorithm interface functions, add following include:
Example code is listed below:
#define PQLR_ALG_OPTION_ENABLE_HW_ACC 0x00000001u |
#define PQLR_ALG_OPTION_ENABLE_PROXY 0x00000002u |
typedef struct pqlr_alg_st* pqlr_alg |
PQLR algorithm instance handle.
Frees pqlr_alg instance and all corresponding resources.
[in] | alg | PQLR algorithm instance |
Gets parameter set configured for given algorithm instance.
[in] | alg | PQLR algorithm instance |
PQLR_ALG_ERROR
on failure Gets parameter set id for given algorithm and paramset string.
[in] | alg | PQLR algorithm instance |
[in] | paramset_str | Algorithm paramset string |
PQLR_ALG_ERROR
on failure Gets parameter set string for given algorithm and id.
Usage:
[in] | alg | PQLR algorithm instance |
[in] | paramset | Algorithm paramset id |
NULL
on failure PQLR_API size_t pqlr_alg_get_paramset_strs | ( | const pqlr_alg | alg, |
const char ** | paramsets, | ||
size_t | count | ||
) |
Fills the provided buffer with names of available parameter sets for given algorithm.
Usage:
[in] | alg | PQLR algorithm instance |
[out] | paramsets | Array of parameter set names |
[in] | count | Array size |
Gets a string with the name of PQLR algorithm.
[in] | alg | PQLR algorithm instance |
PQLR_ALG_UNKNOWN
in case of error. Creates pqlr_alg instance.
[in] | alg_str | PQLR algorithm name |
NULL
in case of error Gets available parameter sets for this algorithm. If the return value is n
then all parameter sets from range [0; n)
can be used.
[in] | alg | PQLR algorithm instance |
PQLR_ALG_ERROR
in case of error Configures the PQLR algorithm with default parameter and options set.
[in] | alg | PQLR algorithm instance |
Enables selected option.
[in] | alg | PQLR algorithm instance |
[in] | options | Algorithm option to be enabled |
Enables selected parameter set.
Usage:
<algorithm>_parameterset_t
.[in] | alg | PQLR algorithm instance |
[in] | paramset | Algorithm paramset to be enabled |