PQLR
Postquantum Crypto Library by QAPP
saber.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 
53 typedef enum {
59 
65 typedef struct saber_st* saber_t;
66 
79 
88 
97 
107 
117 
127 
137 
150 
169  const saber_t saber, uint8_t* public_key, uint8_t* secret_key);
170 
193  const saber_t saber,
194  const uint8_t* public_key,
195  uint8_t* ciphertext,
196  uint8_t* session_key);
197 
217  const saber_t saber,
218  const uint8_t* secret_key,
219  const uint8_t* ciphertext,
220  uint8_t* session_key);
221 
222 #ifdef __cplusplus
223 } // extern "C"
224 #endif //__cplusplus
225 
#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 saber_key_decap(const saber_t saber, const uint8_t *secret_key, const uint8_t *ciphertext, uint8_t *session_key)
Last step of key distribution. Decapsulates key on the initiator side.
PQLR_API uint32_t saber_get_ciphertext_length(saber_t saber)
Obtains ciphertext (request) length for the current saber instance.
saber_parameterset_t
Possible saber parameters sets.
Definition: saber.h:53
PQLR_API uint32_t saber_get_initiator_secret_length(saber_t saber)
Obtains initiator's secret key length for the current saber instance.
PQLR_API saber_t saber_new(saber_parameterset_t parameterset)
Creates saber instance initialized by parameterset.
PQLR_API void saber_key_encap(const saber_t saber, const uint8_t *public_key, uint8_t *ciphertext, uint8_t *session_key)
Second step of key distribution. Encapsulates key on the responder side.
struct saber_st * saber_t
Saber algorithm instance handle.
Definition: saber.h:65
PQLR_API saber_t saber_duplicate(const saber_t saber)
duplicates context of saber algorithm
PQLR_API uint32_t saber_get_initiator_public_length(saber_t saber)
Obtains initiator's public key length for the current saber instance.
PQLR_API void saber_free(saber_t saber)
Frees saber instance and all corresponding resources.
PQLR_API pqlr_t saber_to_pqlr(saber_t saber)
Gets pqlr instance linked to this saber instance.
PQLR_API void saber_keygen(const saber_t saber, 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 saber_get_shared_secret_length(saber_t saber)
Obtains shared secret (key) length for the current saber instance.
@ saber_lightsaber
Definition: saber.h:55
@ saber_classic
Definition: saber.h:54
@ saber_firesaber
Definition: saber.h:56
@ saber_last
Definition: saber.h:57