57QSC_CPLUSPLUS_ENABLED_START
113#if defined(QSC_ECDH_S1P256)
118# define QSC_ECDH_PUBLICKEY_SIZE 64U
124# define QSC_ECDH_PRIVATEKEY_SIZE 32U
130# define QSC_ECDH_SHAREDSECRET_SIZE 32U
136# define QSC_ECDH_SEED_SIZE 32U
142# define QSC_ECDH_ALGNAME "ECDH-P256"
144#elif defined(QSC_ECDH_S3P384)
150# define QSC_ECDH_PUBLICKEY_SIZE 96U
156# define QSC_ECDH_PRIVATEKEY_SIZE 48U
162# define QSC_ECDH_SHAREDSECRET_SIZE 48U
168# define QSC_ECDH_SEED_SIZE 48U
174# define QSC_ECDH_ALGNAME "ECDH-P384"
176#elif defined(QSC_ECDH_S5P521)
182# define QSC_ECDH_PUBLICKEY_SIZE 132U
188# define QSC_ECDH_PRIVATEKEY_SIZE 66U
194# define QSC_ECDH_SHAREDSECRET_SIZE 66U
200# define QSC_ECDH_SEED_SIZE 66U
206# define QSC_ECDH_ALGNAME "ECDH-P521"
209# error "No ECDH parameter set defined. Define QSC_ECDH_S1EC25519 or QSC_ECDH_S3EC448."
268QSC_CPLUSPLUS_ENABLED_END
QSC_EXPORT_API bool qsc_ecdh_generate_seeded_keypair(uint8_t *publickey, uint8_t *privatekey, const uint8_t *seed)
Generates public and private keys for the ECDH key encapsulation mechanism using a seed.
Definition ecdh.c:43
QSC_EXPORT_API bool qsc_ecdh_generate_keypair(uint8_t *publickey, uint8_t *privatekey, bool(*rng_generate)(uint8_t *, size_t))
Generates public and private keys for the ECDH key encapsulation mechanism.
Definition ecdh.c:13
QSC_EXPORT_API void qsc_ecdh_public_from_private(uint8_t *publickey, const uint8_t *privatekey)
Derives a public key from an existing private key.
Definition ecdh.c:97
QSC_EXPORT_API bool qsc_ecdh_key_exchange(uint8_t *secret, const uint8_t *privatekey, const uint8_t *publickey)
Decapsulates the shared secret for a given cipher-text using a private-key.
Definition ecdh.c:73
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 qsccommon.h:645