47QSC_CPLUSPLUS_ENABLED_START
63#if defined(QSC_NTRU_S1HPS2048509)
69# define QSC_NTRU_CIPHERTEXT_SIZE 699ULL
75# define QSC_NTRU_PRIVATEKEY_SIZE 6492ULL
81# define QSC_NTRU_PUBLICKEY_SIZE 699ULL
83#elif defined(QSC_NTRU_S3HPS2048677)
89# define QSC_NTRU_CIPHERTEXT_SIZE 930ULL
95# define QSC_NTRU_PRIVATEKEY_SIZE 1234ULL
101# define QSC_NTRU_PUBLICKEY_SIZE 930ULL
103#elif defined(QSC_NTRU_S5HPS4096821)
109# define QSC_NTRU_CIPHERTEXT_SIZE 1230ULL
115# define QSC_NTRU_PRIVATEKEY_SIZE 1590ULL
121# define QSC_NTRU_PUBLICKEY_SIZE 1230ULL
123#elif defined(QSC_NTRU_S5HRSS701)
129# define QSC_NTRU_CIPHERTEXT_SIZE 1138ULL
135# define QSC_NTRU_PRIVATEKEY_SIZE 1450ULL
141# define QSC_NTRU_PUBLICKEY_SIZE 1138ULL
144# error "The NTRU parameter set is invalid!"
151#define QSC_NTRU_SEED_SIZE 32ULL
157#define QSC_NTRU_SHAREDSECRET_SIZE 32ULL
163#define QSC_NTRU_ALGNAME "NTRU"
222QSC_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 void qsc_ntru_encapsulate(uint8_t *secret, uint8_t *ciphertext, const uint8_t *publickey, bool(*rng_generate)(uint8_t *, size_t))
Encapsulates a shared secret using a public-key.
Definition ntru.c:40
QSC_EXPORT_API bool qsc_ntru_decrypt(uint8_t *secret, const uint8_t *ciphertext, const uint8_t *privatekey)
Decrypts the shared secret using a private-key.
Definition ntru.c:22
QSC_EXPORT_API void qsc_ntru_encrypt(uint8_t *secret, uint8_t *ciphertext, const uint8_t *publickey, const uint8_t seed[QSC_NTRU_SEED_SIZE])
Encrypts and encapsulates a shared secret using a public-key.
Definition ntru.c:53
#define QSC_NTRU_SEED_SIZE
The size of the seed array.
Definition ntru.h:151
QSC_EXPORT_API void qsc_ntru_generate_keypair(uint8_t *publickey, uint8_t *privatekey, bool(*rng_generate)(uint8_t *, size_t))
Generates a public/private key pair for NTRU.
Definition ntru.c:68
QSC_EXPORT_API bool qsc_ntru_decapsulate(uint8_t *secret, const uint8_t *ciphertext, const uint8_t *privatekey)
Decapsulates the shared secret using a private-key.
Definition ntru.c:4