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 
91 
102 
113 
124 
141  const falcon_t falcon, uint8_t* result_sk, uint8_t* result_pk);
142 
169  const falcon_t falcon,
170  const uint8_t* sk,
171  const uint8_t* msg,
172  size_t msg_len,
173  uint8_t* result_sig,
174  size_t* result_sig_len);
175 
199  const falcon_t falcon,
200  const uint8_t* pk,
201  const uint8_t* sig,
202  size_t sig_len,
203  const uint8_t* msg,
204  size_t msg_len);
205 
210 #ifdef __cplusplus
211 } // extern "C"
212 #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)
Casts falcon instance to pqlr instance.
PQLR_API falcon_t falcon_new(falcon_parameterset_t parameterset)
Creates new falcon instance with selected parameter set.