PQLR
Postquantum Crypto Library by QAPP
mceliece.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 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif // __cplusplus
11 
48 typedef enum {
61 
67 typedef struct mceliece_st* mceliece_t;
68 
81 
90 
101 
112 
122 
132 
144 
152 
171  const mceliece_t mceliece, uint8_t* public_key, uint8_t* secret_key);
172 
193  const mceliece_t mceliece,
194  const uint8_t* public_key,
195  uint8_t* ciphertext,
196  uint8_t* session_key);
197 
214  const mceliece_t mceliece,
215  const uint8_t* secret_key,
216  const uint8_t* ciphertext,
217  uint8_t* session_key);
218 
219 #ifdef __cplusplus
220 } // extern "C"
221 #endif //__cplusplus
222 
#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 mceliece_free(mceliece_t mceliece)
Frees mceliece instance and all corresponding resources.
PQLR_API uint32_t mceliece_get_initiator_public_length(mceliece_t mceliece)
Obtains initiator's public key length for the current mceliece instance.
PQLR_API pqlr_t mceliece_to_pqlr(mceliece_t mceliece)
Casts mceliece instance to pqlr instance.
PQLR_API uint32_t mceliece_get_ciphertext_length(mceliece_t mceliece)
Obtains ciphertext length for the current mceliece instance.
PQLR_API uint32_t mceliece_get_initiator_secret_length(mceliece_t mceliece)
Obtains initiator's secret key length for the current mceliece instance.
PQLR_API mceliece_t mceliece_duplicate(const mceliece_t mceliece)
Duplicates context of mceliece instance.
PQLR_API uint32_t mceliece_get_shared_secret_length(mceliece_t mceliece)
Obtains shared secret length for the current mceliece instance.
struct mceliece_st * mceliece_t
McEliece algorithm instance handle.
Definition: mceliece.h:67
PQLR_API mceliece_t mceliece_new(mceliece_parameterset_t parameterset)
Creates mceliece instance initialized by parameterset.
PQLR_API void mceliece_keygen(const mceliece_t mceliece, uint8_t *public_key, uint8_t *secret_key)
Initial step of key distribution. Generates a key pair for key distribution initiator.
mceliece_parameterset_t
Possible mceliece parameters sets.
Definition: mceliece.h:48
PQLR_API void mceliece_key_decap(const mceliece_t mceliece, const uint8_t *secret_key, const uint8_t *ciphertext, uint8_t *session_key)
Key decapsulation.
PQLR_API void mceliece_key_encap(const mceliece_t mceliece, const uint8_t *public_key, uint8_t *ciphertext, uint8_t *session_key)
Key encapsulation.
@ mceliece_last
Definition: mceliece.h:59
@ mceliece8192128f
Definition: mceliece.h:58
@ mceliece6960119f
Definition: mceliece.h:57
@ mceliece348864
Definition: mceliece.h:49
@ mceliece6688128
Definition: mceliece.h:51
@ mceliece6960119
Definition: mceliece.h:52
@ mceliece460896f
Definition: mceliece.h:55
@ mceliece460896
Definition: mceliece.h:50
@ mceliece6688128f
Definition: mceliece.h:56
@ mceliece348864f
Definition: mceliece.h:54
@ mceliece8192128
Definition: mceliece.h:53