PQLR
Postquantum Crypto Library by QAPP
kyber.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 
49 
55 typedef struct kyber_st* kyber_t;
56 
69 
78 
89 
100 
110 
120 
132 
140 
159  const kyber_t kyber, uint8_t* public_key, uint8_t* secret_key);
160 
181  const kyber_t kyber,
182  const uint8_t* public_key,
183  uint8_t* ciphertext,
184  uint8_t* session_key);
185 
202  const kyber_t kyber,
203  const uint8_t* secret_key,
204  const uint8_t* ciphertext,
205  uint8_t* session_key);
206 
207 #ifdef __cplusplus
208 } // extern "C"
209 #endif //__cplusplus
210 
#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 kyber_free(kyber_t kyber)
Frees kyber instance and all corresponding resources.
PQLR_API uint32_t kyber_get_ciphertext_length(kyber_t kyber)
Obtains ciphertext length for the current kyber instance.
PQLR_API uint32_t kyber_get_initiator_public_length(kyber_t kyber)
Obtains initiator's public key length for the current kyber instance.
PQLR_API void kyber_keygen(const kyber_t kyber, uint8_t *public_key, uint8_t *secret_key)
Initial step of key distribution. Generates a key pair for key distribution initiator.
struct kyber_st * kyber_t
Kyber algorithm instance handle.
Definition: kyber.h:55
PQLR_API uint32_t kyber_get_shared_secret_length(kyber_t kyber)
Obtains shared secret length for the current kyber instance.
PQLR_API pqlr_t kyber_to_pqlr(kyber_t kyber)
Casts kyber instance to pqlr instance.
PQLR_API uint32_t kyber_get_initiator_secret_length(kyber_t kyber)
Obtains initiator's secret key length for the current kyber instance.
PQLR_API void kyber_key_decap(const kyber_t kyber, const uint8_t *secret_key, const uint8_t *ciphertext, uint8_t *session_key)
Key decapsulation.
PQLR_API kyber_t kyber_duplicate(const kyber_t kyber)
Duplicates context of kyber instance.
PQLR_API void kyber_key_encap(const kyber_t kyber, const uint8_t *public_key, uint8_t *ciphertext, uint8_t *session_key)
Key encapsulation.
kyber_parameterset_t
Possible kyber parameters sets.
Definition: kyber.h:48
PQLR_API kyber_t kyber_new(kyber_parameterset_t parameterset)
Creates kyber instance initialized by parameterset.
@ kyber768
Definition: kyber.h:48
@ kyber_last
Definition: kyber.h:48
@ kyber1024
Definition: kyber.h:48
@ kyber512
Definition: kyber.h:48