PQLR
Postquantum Crypto Library by QAPP
hypericum.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 
58 typedef struct hypericum_st* hypericum_t;
59 
71 
80 
90 
102 
113 
124 
135 
154  const hypericum_t hypericum, uint8_t* result_sk, uint8_t* result_pk);
155 
156 
182  const hypericum_t hypericum,
183  const uint8_t* sk,
184  const uint8_t* msg,
185  size_t msg_len,
186  uint8_t* result_sig,
187  size_t* result_sig_len);
188 
189 
215  const hypericum_t hypericum,
216  const uint8_t* pk,
217  const uint8_t* sig,
218  size_t sig_len,
219  const uint8_t* msg,
220  size_t msg_len);
221 
226 #ifdef __cplusplus
227 } // extern "C"
228 #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 int hypericum_verify(const hypericum_t hypericum, 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 hypericum_free(hypericum_t hypericum)
Frees hypericum instance and all corresponding resources.
PQLR_API hypericum_t hypericum_new(hypericum_parameterset_t parameterset)
Creates new hypericum instance with selected parameter set.
PQLR_API size_t hypericum_get_public_key_bytes_len(hypericum_t hypericum)
Obtains public key buffer length in bytes for current hypericum instance.
PQLR_API size_t hypericum_get_secret_key_bytes_len(hypericum_t hypericum)
Obtains secret key buffer length in bytes for current hypericum instance.
PQLR_API void hypericum_generate_keys(const hypericum_t hypericum, uint8_t *result_sk, uint8_t *result_pk)
Generates random secret key and public key for given context.
PQLR_API void hypericum_sign(const hypericum_t hypericum, 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...
hypericum_parameterset_t
Parameter set.
Definition: params.h:40
PQLR_API size_t hypericum_get_signature_bytes_len(hypericum_t hypericum)
Obtains signature buffer length in bytes for current hypericum instance.
struct hypericum_st * hypericum_t
hypericum algorithm instance handle
Definition: hypericum.h:58
PQLR_API pqlr_t hypericum_to_pqlr(hypericum_t hypericum)
Casts hypericum instance to pqlr instance.
PQLR_API hypericum_t hypericum_duplicate(const hypericum_t hypericum)
Duplicates hypericum context.