PQLR
Postquantum Crypto Library by QAPP
falcon.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "params.h"
4 
5 #include <pqlr/common/pqlr.h>
6 #include <pqlr/common/api.h>
7 
8 #include <stdint.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif // __cplusplus
13 
14 
50 typedef struct falcon_st* falcon_t;
51 
61 
70 
79 
92 
103 
114 
125 
142  const falcon_t falcon, uint8_t* result_sk, uint8_t* result_pk);
143 
170  const falcon_t falcon,
171  const uint8_t* sk,
172  const uint8_t* msg,
173  size_t msg_len,
174  uint8_t* result_sig,
175  size_t* result_sig_len);
176 
200  const falcon_t falcon,
201  const uint8_t* pk,
202  const uint8_t* sig,
203  size_t sig_len,
204  const uint8_t* msg,
205  size_t msg_len);
206 
211 #ifdef __cplusplus
212 } // extern "C"
213 #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
PQLR_API void falcon_generate_keys(const falcon_t falcon, uint8_t *result_sk, uint8_t *result_pk)
Generates random secret key and public key for given context.
PQLR_API void falcon_free(falcon_t falcon)
Frees falcon instance and all corresponding resources.
struct falcon_st * falcon_t
Falcon algorithm instance handle.
Definition: falcon.h:50
falcon_parameterset_t
Parameter set.
Definition: params.h:20
PQLR_API falcon_t falcon_duplicate(const falcon_t src)
Duplicates context copying all related resources.
PQLR_API size_t falcon_get_secret_key_bytes_len(falcon_t falcon)
Obtains secret key buffer length in bytes for current falcon instance.
PQLR_API int falcon_verify(const falcon_t falcon, 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 falcon_sign(const falcon_t falcon, 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. The signature is non-deter...
PQLR_API size_t falcon_get_signature_bytes_len(falcon_t falcon)
Obtains signature buffer length in bytes for current falcon instance.
PQLR_API size_t falcon_get_public_key_bytes_len(falcon_t falcon)
Obtains public key buffer length in bytes for current falcon instance.
PQLR_API pqlr_t falcon_to_pqlr(falcon_t falcon)
Gets pqlr instance linked to this falcon instance.
PQLR_API falcon_t falcon_new(falcon_parameterset_t parameterset)
Creates new falcon instance with selected parameter set.