62#if defined(QSC_NTRU_S1HPS2048509)
68# define QSC_NTRU_CIPHERTEXT_SIZE 699ULL
74# define QSC_NTRU_PRIVATEKEY_SIZE 6492ULL
80# define QSC_NTRU_PUBLICKEY_SIZE 699ULL
82#elif defined(QSC_NTRU_S3HPS2048677)
88# define QSC_NTRU_CIPHERTEXT_SIZE 930ULL
94# define QSC_NTRU_PRIVATEKEY_SIZE 1234ULL
100# define QSC_NTRU_PUBLICKEY_SIZE 930ULL
102#elif defined(QSC_NTRU_S5HPS4096821)
108# define QSC_NTRU_CIPHERTEXT_SIZE 1230ULL
114# define QSC_NTRU_PRIVATEKEY_SIZE 1590ULL
120# define QSC_NTRU_PUBLICKEY_SIZE 1230ULL
122#elif defined(QSC_NTRU_S5HRSS701)
128# define QSC_NTRU_CIPHERTEXT_SIZE 1138ULL
134# define QSC_NTRU_PRIVATEKEY_SIZE 1450ULL
140# define QSC_NTRU_PUBLICKEY_SIZE 1138ULL
143# error "The NTRU parameter set is invalid!"
150#define QSC_NTRU_SEED_SIZE 32ULL
156#define QSC_NTRU_SHAREDSECRET_SIZE 32ULL
162#define QSC_NTRU_ALGNAME "NTRU"
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:511
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:150
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