46QSC_CPLUSPLUS_ENABLED_START
85#if defined(QSC_MCELIECE_S1N3488T64)
91# define QSC_MCELIECE_CIPHERTEXT_SIZE 128
97# define QSC_MCELIECE_PRIVATEKEY_SIZE 6492
103# define QSC_MCELIECE_PUBLICKEY_SIZE 261120
105#elif defined(QSC_MCELIECE_S3N4608T96)
111# define QSC_MCELIECE_CIPHERTEXT_SIZE 188
117# define QSC_MCELIECE_PRIVATEKEY_SIZE 13608
123# define QSC_MCELIECE_PUBLICKEY_SIZE 524160
125#elif defined(QSC_MCELIECE_S5N6688T128)
131# define QSC_MCELIECE_CIPHERTEXT_SIZE 240
137# define QSC_MCELIECE_PRIVATEKEY_SIZE 13932
143# define QSC_MCELIECE_PUBLICKEY_SIZE 1044992
145#elif defined(QSC_MCELIECE_S6N6960T119)
151# define QSC_MCELIECE_CIPHERTEXT_SIZE 226
157# define QSC_MCELIECE_PRIVATEKEY_SIZE 13948
163# define QSC_MCELIECE_PUBLICKEY_SIZE 1047319
165#elif defined(QSC_MCELIECE_S7N8192T128)
171# define QSC_MCELIECE_CIPHERTEXT_SIZE 240
177# define QSC_MCELIECE_PRIVATEKEY_SIZE 14120
183# define QSC_MCELIECE_PUBLICKEY_SIZE 1357824
186# error "The McEliece parameter set is invalid!"
193#define QSC_MCELIECE_SEED_SIZE 32ULL
199#define QSC_MCELIECE_SHAREDSECRET_SIZE 32ULL
205#define QSC_MCELIECE_ALGNAME "MCELIECE"
256QSC_CPLUSPLUS_ENABLED_END
Contains common definitions for the Quantum Secure Cryptographic (QSC) library.
#define QSC_EXPORT_API
API export macro for Microsoft compilers when importing from a DLL.
Definition common.h:520
QSC_EXPORT_API bool qsc_mceliece_decapsulate(uint8_t *secret, const uint8_t *ciphertext, const uint8_t *privatekey)
Decapsulates the shared secret for a given ciphertext using a private key.
Definition mceliece.c:5
QSC_EXPORT_API void qsc_mceliece_encapsulate(uint8_t *secret, uint8_t *ciphertext, const uint8_t *publickey, bool(*rng_generate)(uint8_t *, size_t))
Encapsulates a shared secret key using a public key.
Definition mceliece.c:41
QSC_EXPORT_API void qsc_mceliece_generate_keypair(uint8_t *publickey, uint8_t *privatekey, bool(*rng_generate)(uint8_t *, size_t))
Generates a McEliece public/private key pair.
Definition mceliece.c:69
#define QSC_MCELIECE_SEED_SIZE
The byte size of the seed array.
Definition mceliece.h:193
QSC_EXPORT_API void qsc_mceliece_encrypt(uint8_t *secret, uint8_t *ciphertext, const uint8_t *publickey, const uint8_t seed[QSC_MCELIECE_SEED_SIZE])
Encrypts to encapsulate a shared secret key using a public key.
Definition mceliece.c:54
QSC_EXPORT_API bool qsc_mceliece_decrypt(uint8_t *secret, const uint8_t *ciphertext, const uint8_t *privatekey)
Decrypts the shared secret for a given ciphertext using a private key.
Definition mceliece.c:23