PQLR
Postquantum Crypto Library
 
Loading...
Searching...
No Matches
alg.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4#include <stddef.h>
5
6#define PQLR_ALG_UNKNOWN "unknown"
7#define PQLR_ALG_ERROR -1
8
9#ifdef __cplusplus
10extern "C" {
11#endif // __cplusplus
12
13#include <pqlr/common/api.h>
14
28#define PQLR_ALG_OPTION_ENABLE_HW_ACC 0x00000001u
29#define PQLR_ALG_OPTION_ENABLE_PROXY 0x00000002u
30
40typedef struct pqlr_alg_st* pqlr_alg;
41
52PQLR_API pqlr_alg pqlr_alg_new(const char* alg_str);
53
61
70PQLR_API const char* pqlr_alg_get_str(const pqlr_alg alg);
71
81
92
110
127 const pqlr_alg alg, int paramset);
128
140 const pqlr_alg alg, const char* paramset_str);
141
163 const pqlr_alg alg, const char** paramsets, size_t count);
164
176PQLR_API int pqlr_alg_set_options(pqlr_alg alg, uint32_t options);
177
188
193#ifdef __cplusplus
194} // extern "C"
195#endif //__cplusplus
#define PQLR_API
Definition api.h:22
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 fr...
PQLR_API int pqlr_alg_get_paramset(const pqlr_alg alg)
Gets parameter set configured for given algorithm instance.
struct pqlr_alg_st * pqlr_alg
PQLR algorithm instance handle.
Definition alg.h:40
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.
PQLR_API const char * pqlr_alg_get_str(const pqlr_alg alg)
Gets a string with the name of PQLR algorithm.
PQLR_API void pqlr_alg_set_defaults(pqlr_alg alg)
Configures the PQLR algorithm with default parameter and options set.
PQLR_API int pqlr_alg_set_paramset(pqlr_alg alg, int paramset)
Enables selected parameter set.
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.
PQLR_API void pqlr_alg_free(pqlr_alg alg)
Frees pqlr_alg instance and all corresponding resources.
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.
PQLR_API int pqlr_alg_set_options(pqlr_alg alg, uint32_t options)
Enables selected option.
PQLR_API pqlr_alg pqlr_alg_new(const char *alg_str)
Creates pqlr_alg instance.