Commit caa0f28a authored by Niels Möller's avatar Niels Möller
Browse files

* src/encrypt.c (encrypt_packet): Deleted randomness argument.

* src/dh_exchange.c (dh_generate_secret): Deleted randomness
argument.

Rev: src/crypto.h:1.38
Rev: src/dh_exchange.c:1.22
Rev: src/encrypt.c:1.29
parent 9f71e335
......@@ -114,6 +114,8 @@ hash_digest_string(struct hash_instance *self);
struct hash_instance *
hash_copy(struct hash_instance *self);
/* FIXME: We don't need a class for this, we can just pass around a
pointer to the corresponding nettle_hash. */
/* GABA:
(class
(name hash_algorithm)
......@@ -242,8 +244,7 @@ make_ssh_rsa_verifier(uint32_t length, const uint8_t *key);
/* DSA signatures */
struct signature_algorithm *
make_dsa_algorithm(struct randomness *random);
extern struct signature_algorithm dsa_algorithm;
/* Non spki keys */
struct verifier *
......@@ -323,7 +324,6 @@ dh_hash_update(struct dh_state *self,
void
dh_generate_secret(const struct dh_params *self,
struct randomness *random,
mpz_t r, mpz_t v);
void
......@@ -366,6 +366,6 @@ struct compress_instance;
struct lsh_string *
encrypt_packet(struct lsh_string *packet, struct compress_instance *compress,
struct crypto_instance *crypt, struct mac_instance *mac,
struct randomness *random, uint32_t seqno);
uint32_t seqno);
#endif /* LSH_CRYPTO_H_INCLUDED */
......@@ -143,18 +143,14 @@ init_dh_state(struct dh_state *self,
/* R is set to a random, secret, exponent, and V set to is g^r */
void
dh_generate_secret(const struct dh_params *self,
struct randomness *random,
mpz_t r, mpz_t v)
dh_generate_secret(const struct dh_params *self, mpz_t r, mpz_t v)
{
mpz_t tmp;
assert(random->quality == RANDOM_GOOD);
/* Generate a random number, 1 < x < O(G) = (p-1)/2 */
mpz_init_set(tmp, self->modulo);
mpz_sub_ui(tmp, tmp, 2);
nettle_mpz_random(r, random, lsh_random, tmp);
nettle_mpz_random(r, NULL, lsh_random, tmp);
mpz_add_ui(r, r, 1);
mpz_clear(tmp);
......
......@@ -36,7 +36,7 @@
struct lsh_string *
encrypt_packet(struct lsh_string *packet, struct compress_instance *compress,
struct crypto_instance *crypt, struct mac_instance *mac,
struct randomness *random, uint32_t seqno)
uint32_t seqno)
{
uint32_t block_size;
uint32_t new_size;
......@@ -83,7 +83,7 @@ encrypt_packet(struct lsh_string *packet, struct compress_instance *compress,
assert(new_size + mac_length == lsh_string_length(packet));
lsh_string_write_random(packet, padding, random, padding_length);
lsh_string_write_random(packet, padding, padding_length);
if (mac)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment