PQLR  dev-1426-v1.4-474-b578073a
Postquantum Crypto Library by QAPP
sphincs_plus.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>
8 
9 #include <stdint.h>
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif // __cplusplus
14 
15 
60 typedef struct sphincs_plus_st* sphincs_plus_t;
61 
77 
85 PQLR_API void sphincs_plus_free(sphincs_plus_t sphincs_plus);
86 
96 sphincs_plus_duplicate(const sphincs_plus_t sphincs_plus);
97 
109 
119 PQLR_API size_t
121 
131 PQLR_API size_t
133 
143 PQLR_API size_t
145 
162  const sphincs_plus_t sphincs_plus, uint8_t* result_sk, uint8_t* result_pk);
163 
164 
187  const sphincs_plus_t sphincs_plus,
188  const uint8_t* sk,
189  const uint8_t* msg,
190  size_t msg_len,
191  uint8_t* result_sig);
192 
193 
216  const sphincs_plus_t sphincs_plus,
217  const uint8_t* pk,
218  const uint8_t* sig,
219  const uint8_t* msg,
220  size_t msg_len);
221 
226 #ifdef __cplusplus
227 } // extern "C"
228 #endif // __cplusplus
PQLR_API sphincs_plus_t sphincs_plus_duplicate(const sphincs_plus_t sphincs_plus)
Duplicates sphincs_plus context.
#define PQLR_API
Definition: api.h:10
struct sphincs_plus_st * sphincs_plus_t
Sphincs_plus algorithm instance handle.
Definition: sphincs_plus.h:60
PQLR_API void sphincs_plus_generate_keys(const sphincs_plus_t sphincs_plus, uint8_t *result_sk, uint8_t *result_pk)
Generates random secret key and public key for given context.
PQLR_API size_t sphincs_plus_get_public_key_bytes_len(sphincs_plus_t sphincs_plus)
Obtains public key buffer length in bytes for current sphincs_plus instance.
PQLR_API int sphincs_plus_verify(const sphincs_plus_t sphincs_plus, const uint8_t *pk, const uint8_t *sig, const uint8_t *msg, size_t msg_len)
Verifies that given signature is the signature of given message.
struct pqlr_st * pqlr_t
Pqlr instance handle. Pqlr represents basic library and it's algorithms configuration....
Definition: pqlr.h:26
sphincs_plus_parameterset_t
Parameter set.
Definition: params.h:42
PQLR_API sphincs_plus_t sphincs_plus_new(sphincs_plus_parameterset_t parameterset, hashalgo_t hashalgo)
Creates new sphincs_plus instance with selected parameter set and hashing algorithm.
PQLR_API size_t sphincs_plus_get_signature_bytes_len(sphincs_plus_t sphincs_plus)
Obtains signature buffer length in bytes for current sphincs_plus instance.
PQLR_API void sphincs_plus_free(sphincs_plus_t sphincs_plus)
Frees sphincs_plus instance and all corresponding resources.
hashalgo_t
Hashing algorithm.
Definition: hash_algo.h:21
PQLR_API size_t sphincs_plus_get_secret_key_bytes_len(sphincs_plus_t sphincs_plus)
Obtains secret key buffer length in bytes for current sphincs_plus instance.
PQLR_API void sphincs_plus_sign(const sphincs_plus_t sphincs_plus, const uint8_t *sk, const uint8_t *msg, size_t msg_len, uint8_t *result_sig)
Generates signature for given message according to context and secret key. The signature is non-deter...
PQLR_API pqlr_t sphincs_plus_to_pqlr(sphincs_plus_t sphincs_plus)
Casts sphincs_plus instance to pqlr instance.