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 
92 
102 PQLR_API size_t
104 
114 PQLR_API size_t
116 
127 
145  const kryzhovnik_t kryzhovnik, uint8_t* result_sk, uint8_t* result_pk);
146 
173  const kryzhovnik_t kryzhovnik,
174  const uint8_t* sk,
175  const uint8_t* msg,
176  size_t msg_len,
177  uint8_t* result_sig,
178  size_t* result_sig_len);
179 
203  const kryzhovnik_t kryzhovnik,
204  const uint8_t* pk,
205  const uint8_t* sig,
206  size_t sig_len,
207  const uint8_t* msg,
208  size_t msg_len);
209  // Close the group
211 
212 
213 #ifdef __cplusplus
214 } // extern "C"
215 #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)
Casts kryzhovnik instance to pqlr instance.
@ kryzhovnik_default
Definition: kryzhovnik.h:44
@ kryzhovnik_last
Definition: kryzhovnik.h:44