diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-02-13 18:03:31 +0000 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2002-02-13 18:03:31 +0000 |
commit | f577c848c249c3e9499117d7c58d9251ae37bdc7 (patch) | |
tree | e66b1d4d26acb80291c7b7d887481d71648022dc /lib/gnutls_dh.c | |
parent | 49cdd41f1678b93823a10a84fa2e68b39742abdf (diff) | |
download | gnutls-f577c848c249c3e9499117d7c58d9251ae37bdc7.tar.gz |
Added more functions to allow access to Diffie Hellman parameters
(partially at least). Corrected Diffie Hellman stuff.
Diffstat (limited to 'lib/gnutls_dh.c')
-rw-r--r-- | lib/gnutls_dh.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/gnutls_dh.c b/lib/gnutls_dh.c index 5871e2c959..48f64a574b 100644 --- a/lib/gnutls_dh.c +++ b/lib/gnutls_dh.c @@ -32,7 +32,7 @@ your_key = Y ^ x mod p; his_key = X ^ y mod p; -// generate our secret and the public value for it +// generate our secret and the public value (X) for it X = gnutls_calc_dh_secret(&x, g, p); // now we can calculate the shared secret key = gnutls_calc_dh_key(Y, x, g, p); @@ -55,6 +55,8 @@ static int get_x_size(int bits) return 1024; } +/* returns the public value (X), and the secret (ret_x). + */ MPI gnutls_calc_dh_secret(MPI * ret_x, MPI g, MPI prime) { MPI e, x; @@ -97,12 +99,3 @@ MPI gnutls_calc_dh_key(MPI f, MPI x, MPI prime) return k; } -/* returns the bits the user requested for DH key exchange. - */ -int _gnutls_dh_get_bits(GNUTLS_STATE state) -{ - if (state->gnutls_internals.dh_bits>=MIN_BITS) - return state->gnutls_internals.dh_bits; - else - return MIN_BITS; -} |