PQLR  dev-1426-v1.4-474-b578073a
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 
89 PQLR_API void mceliece_free(mceliece_t mceliece);
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 
Definition: mceliece.h:49
struct mceliece_st * mceliece_t
McEliece algorithm instance handle.
Definition: mceliece.h:67
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 uint32_t mceliece_get_ciphertext_length(mceliece_t mceliece)
Obtains ciphertext length for the current mceliece instance.
Definition: mceliece.h:56
Definition: mceliece.h:59
mceliece_parameterset_t
Possible mceliece parameters sets.
Definition: mceliece.h:48
#define PQLR_API
Definition: api.h:10
Definition: mceliece.h:57
Definition: mceliece.h:53
struct pqlr_st * pqlr_t
Pqlr instance handle. Pqlr represents basic library and it's algorithms configuration....
Definition: pqlr.h:26
Definition: mceliece.h:51
Definition: mceliece.h:50
PQLR_API mceliece_t mceliece_duplicate(const mceliece_t mceliece)
Duplicates context of mceliece instance.
Definition: mceliece.h:58
PQLR_API void mceliece_key_encap(const mceliece_t mceliece, const uint8_t *public_key, uint8_t *ciphertext, uint8_t *session_key)
Key encapsulation.
Definition: mceliece.h:52
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.
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 void mceliece_free(mceliece_t mceliece)
Frees mceliece instance and all corresponding resources.
Definition: mceliece.h:55
PQLR_API pqlr_t mceliece_to_pqlr(mceliece_t mceliece)
Casts mceliece instance to pqlr instance.
PQLR_API uint32_t mceliece_get_shared_secret_length(mceliece_t mceliece)
Obtains shared secret length for the current mceliece instance.
Definition: mceliece.h:54
PQLR_API uint32_t mceliece_get_initiator_public_length(mceliece_t mceliece)
Obtains initiator's public key length for the current mceliece instance.