PQLR
Postquantum Crypto Library by QAPP
kryzhovnik.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "pqlr/common/pqlr.h"
4 #include "pqlr/common/api.h"
5 
6 #include "stdint.h"
7 #include "stddef.h"
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif // __cplusplus
12 
45 
51 typedef struct kryzhovnik_st* kryzhovnik_t;
52 
63 
72 
80 
93 
103 PQLR_API size_t
105 
115 PQLR_API size_t
117 
128 
146  const kryzhovnik_t kryzhovnik, uint8_t* result_sk, uint8_t* result_pk);
147 
174  const kryzhovnik_t kryzhovnik,
175  const uint8_t* sk,
176  const uint8_t* msg,
177  size_t msg_len,
178  uint8_t* result_sig,
179  size_t* result_sig_len);
180 
204  const kryzhovnik_t kryzhovnik,
205  const uint8_t* pk,
206  const uint8_t* sig,
207  size_t sig_len,
208  const uint8_t* msg,
209  size_t msg_len);
210  // Close the group
212 
213 
214 #ifdef __cplusplus
215 } // extern "C"
216 #endif //__cplusplus
#define PQLR_API
Definition: api.h:22
struct pqlr_st * pqlr_t
Pqlr instance handle. Pqlr represents basic library and it's algorithms configuration....
Definition: pqlr.h:26
kryzhovnik_parameterset_t
Possible kryzhovnik parameters sets.
Definition: kryzhovnik.h:44
PQLR_API void kryzhovnik_generate_keys(const kryzhovnik_t kryzhovnik, uint8_t *result_sk, uint8_t *result_pk)
Generates random secret key and public key for given context.
PQLR_API void kryzhovnik_sign(const kryzhovnik_t kryzhovnik, const uint8_t *sk, const uint8_t *msg, size_t msg_len, uint8_t *result_sig, size_t *result_sig_len)
Generates signature for given message according to context and secret key.
PQLR_API size_t kryzhovnik_get_public_key_bytes_len(const kryzhovnik_t kryzhovnik)
Obtains public key buffer length in bytes for current kryzhovnik instance.
PQLR_API kryzhovnik_t kryzhovnik_new(kryzhovnik_parameterset_t parameterset)
Creates new kryzhovnik instance with selected parameter set.
PQLR_API size_t kryzhovnik_get_secret_key_bytes_len(const kryzhovnik_t kryzhovnik)
Obtains secret key buffer length in bytes for current kryzhovnik instance.
PQLR_API kryzhovnik_t kryzhovnik_duplicate(const kryzhovnik_t kryzhovnik)
Duplicates context of kryzhovnik instance.
PQLR_API size_t kryzhovnik_get_signature_bytes_len(kryzhovnik_t kryzhovnik)
Obtains signature buffer length in bytes for current kryzhovnik instance.
struct kryzhovnik_st * kryzhovnik_t
kryzhovnik algorithm instance handle
Definition: kryzhovnik.h:51
PQLR_API int kryzhovnik_verify(const kryzhovnik_t kryzhovnik, const uint8_t *pk, const uint8_t *sig, size_t sig_len, const uint8_t *msg, size_t msg_len)
Verifies that given signature is the signature of given message.
PQLR_API void kryzhovnik_free(kryzhovnik_t kryzhovnik)
Frees kryzhovnik instance and all corresponding resources.
PQLR_API pqlr_t kryzhovnik_to_pqlr(kryzhovnik_t kryzhovnik)
Gets pqlr instance linked to this kryzhovnik instance.
@ kryzhovnik_default
Definition: kryzhovnik.h:44
@ kryzhovnik_last
Definition: kryzhovnik.h:44