Rename diffie_hellman_t to key_exchange_t and change the interface etc.

This makes it more generic so we can use it for QSKE methods.
This commit is contained in:
Tobias Brunner
2022-06-29 10:28:50 +02:00
parent ec95fd9b93
commit 3af7c6db87
130 changed files with 1379 additions and 1384 deletions
+17 -17
View File
@@ -37,7 +37,7 @@ typedef struct kdf_test_vector_t kdf_test_vector_t;
typedef struct kdf_test_args_t kdf_test_args_t;
typedef struct drbg_test_vector_t drbg_test_vector_t;
typedef struct rng_test_vector_t rng_test_vector_t;
typedef struct dh_test_vector_t dh_test_vector_t;
typedef struct ke_test_vector_t ke_test_vector_t;
struct crypter_test_vector_t {
/** encryption algorithm this vector tests */
@@ -182,20 +182,20 @@ struct rng_test_vector_t {
void *user;
};
struct dh_test_vector_t {
/** diffie hellman group to test */
diffie_hellman_group_t group;
/** private value of alice */
struct ke_test_vector_t {
/** key exchange method to test */
key_exchange_method_t method;
/** private key of alice */
u_char *priv_a;
/** private value of bob */
/** private key of bob */
u_char *priv_b;
/** length of private values */
/** length of private keys */
size_t priv_len;
/** expected public value of alice */
/** expected public key of alice */
u_char *pub_a;
/** expected public value of bob */
/** expected public key of bob */
u_char *pub_b;
/** size of public values */
/** size of public keys */
size_t pub_len;
/** expected shared secret */
u_char *shared;
@@ -318,15 +318,15 @@ struct crypto_tester_t {
rng_constructor_t create,
u_int *speed, const char *plugin_name);
/**
* Test a Diffie-Hellman implementation.
* Test a key exchange implementation.
*
* @param group group to test
* @param create constructor function for the DH backend
* @param speed speed test result, NULL to omit
* @param ke key exchange method to test
* @param create constructor function for the key exchange method
* @param speed speeed test result, NULL to omit
* @return TRUE if test passed
*/
bool (*test_dh)(crypto_tester_t *this, diffie_hellman_group_t group,
dh_constructor_t create,
bool (*test_ke)(crypto_tester_t *this, key_exchange_method_t ke,
ke_constructor_t create,
u_int *speed, const char *plugin_name);
/**
@@ -397,7 +397,7 @@ struct crypto_tester_t {
*
* @param vector pointer to test vector
*/
void (*add_dh_vector)(crypto_tester_t *this, dh_test_vector_t *vector);
void (*add_ke_vector)(crypto_tester_t *this, ke_test_vector_t *vector);
/**
* Destroy a crypto_tester_t.