dh_make_key() is now dh_generate_key()

This commit is contained in:
Steffen Jaeckel 2017-07-04 10:30:01 +02:00
parent e647f9a0e4
commit a6aef23438
4 changed files with 8 additions and 8 deletions

View File

@ -909,7 +909,7 @@ static void time_dh(void)
t_start();
t1 = t_read();
if ((err = dh_make_key(&yarrow_prng, find_prng("yarrow"), &key)) != CRYPT_OK) {
if ((err = dh_generate_key(&yarrow_prng, find_prng("yarrow"), &key)) != CRYPT_OK) {
fprintf(stderr, "\n\ndh_make_key says %s, wait...no it should say %s...damn you!\n", error_to_string(err), error_to_string(CRYPT_OK));
exit(EXIT_FAILURE);
}

View File

@ -227,7 +227,7 @@ int dh_set_pg_groupsize(int groupsize, dh_key *key);
int dh_set_key(const unsigned char *pub, unsigned long publen,
const unsigned char *priv, unsigned long privlen,
dh_key *key);
int dh_make_key(prng_state *prng, int wprng, dh_key *key);
int dh_generate_key(prng_state *prng, int wprng, dh_key *key);
int dh_shared_secret(dh_key *private_key, dh_key *public_key,
unsigned char *out, unsigned long *outlen);

View File

@ -42,7 +42,7 @@ static int _dh_groupsize_to_keysize(int groupsize)
}
}
int dh_make_key(prng_state *prng, int wprng, dh_key *key)
int dh_generate_key(prng_state *prng, int wprng, dh_key *key)
{
unsigned char *buf;
unsigned long keysize;

View File

@ -127,7 +127,7 @@ static int _dhparam_test(void)
};
DO(dh_set_pg_dhparam(dhparam_der, sizeof(dhparam_der), &k));
DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), &k));
DO(dh_generate_key(&yarrow_prng, find_prng ("yarrow"), &k));
if (mp_unsigned_bin_size(k.prime) > sizeof(buf)) {
printf("dhparam_test: short buf\n");
dh_free(&k);
@ -339,7 +339,7 @@ static int _set_test(void)
dh_free(&k2);
DO(dh_set_pg(test[i].p, test[i].plen, test[i].g, test[i].glen, &k3));
DO(dh_make_key(&yarrow_prng, find_prng("yarrow"), &k3));
DO(dh_generate_key(&yarrow_prng, find_prng("yarrow"), &k3));
len = mp_unsigned_bin_size(k3.prime);
DO(mp_to_unsigned_bin(k3.prime, buf));
@ -370,9 +370,9 @@ static int _basic_test(void)
/* make up two keys */
DO(dh_set_pg_groupsize(KEYSIZE/8, &usera));
DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), &usera));
DO(dh_generate_key(&yarrow_prng, find_prng ("yarrow"), &usera));
DO(dh_set_pg_groupsize(KEYSIZE/8, &userb));
DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), &userb));
DO(dh_generate_key(&yarrow_prng, find_prng ("yarrow"), &userb));
/* make the shared secret */
x = KEYSIZE;
@ -417,7 +417,7 @@ static int _basic_test(void)
for (x = 0; ltc_dh_sets[x].size != 0; x++) {
DO(dh_set_pg_groupsize(ltc_dh_sets[x].size, &usera));
DO(dh_make_key(&yarrow_prng, find_prng ("yarrow"), &usera));
DO(dh_generate_key(&yarrow_prng, find_prng ("yarrow"), &usera));
size = dh_get_groupsize(&usera);
dh_free(&usera);
if (size != ltc_dh_sets[x].size) {