Contains the primary public API for the Elliptic Curve Diffie-Hellman key exchange. More...
#include "common.h"
Go to the source code of this file.
Functions | |
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. | |
QSC_EXPORT_API void | 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. | |
QSC_EXPORT_API void | 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. | |
Contains the primary public API for the Elliptic Curve Diffie-Hellman key exchange.
This header defines the API for the ECDH key encapsulation mechanism using the Curve25519/Ed25519 elliptic curve. It provides functions for generating key pairs (either randomly or seeded) and for performing the key exchange operation (decapsulation) to derive a shared secret.
The implementation is based on established protocols for elliptic curve cryptography and leverages the underlying field arithmetic and curve operations of the Ed25519 signature scheme. It is designed for secure key encapsulation in cryptographic protocols and has been optimized for performance and constant-time execution to mitigate side-channel attacks.
QSC_EXPORT_API void 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.
publickey | [uint8_t*] Pointer to the output public-key array. |
privatekey | [uint8_t*] Pointer to the output private-key array. |
rng_generate | [bool (*)(uint8_t*, size_t)] Pointer to the random generator function. |
QSC_EXPORT_API void 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.
publickey | [uint8_t*] Pointer to the output public-key array. |
privatekey | [uint8_t*] Pointer to the output private-key array. |
seed | [const uint8_t*] Pointer to the random seed. |
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.
secret | [uint8_t*] Pointer to the shared secret key array. |
privatekey | [const uint8_t*] Pointer to the private-key array. |
publickey | [const uint8_t*] Pointer to the public-key array. |