#include <gnutls_int.h>
#include <gnutls_errors.h>
#include <gnutls_datum.h>
#include <x509_b64.h>
#include <gnutls_global.h>
#include <gnutls_dh.h>
#include "debug.h"
#include "mpi.h"
Go to the source code of this file.
Functions | |
const mpi_t * | MHD_gtls_dh_params_to_mpi (MHD_gtls_dh_params_t dh_primes) |
int | MHD_gtls_dh_generate_prime (mpi_t *ret_g, mpi_t *ret_n, unsigned int bits) |
int | MHD__gnutls_dh_params_init (MHD_gtls_dh_params_t *dh_params) |
void | MHD__gnutls_dh_params_deinit (MHD_gtls_dh_params_t dh_params) |
int | MHD__gnutls_dh_params_generate2 (MHD_gtls_dh_params_t params, unsigned int bits) |
void MHD__gnutls_dh_params_deinit | ( | MHD_gtls_dh_params_t | dh_params | ) |
MHD__gnutls_dh_params_deinit - This function will deinitialize the DH parameters : Is a structure that holds the prime numbers
This function will deinitialize the DH parameters structure.
Definition at line 171 of file gnutls_dh_primes.c.
References MHD_gnutls_free, MHD_gtls_mpi_release(), and MHD_gtls_dh_params_int::params.
Referenced by deinit_internal_params().
int MHD__gnutls_dh_params_generate2 | ( | MHD_gtls_dh_params_t | params, | |
unsigned int | bits | |||
) |
MHD__gnutls_dh_params_generate2 - This function will generate new DH parameters : Is the structure that the DH parameters will be stored : is the prime's number of bits
This function will generate a new pair of prime and generator for use in the Diffie-Hellman key exchange. The new parameters will be allocated using MHD_gnutls_malloc() and will be stored in the appropriate datum. This function is normally slow.
Note that the bits value should be one of 768, 1024, 2048, 3072 or 4096. Also note that the DH parameters are only useful to servers. Since clients use the parameters sent by the server, it's of no use to call this in client side.
Definition at line 200 of file gnutls_dh_primes.c.
References MHD_gnutls_assert, MHD_gtls_dh_generate_prime(), and MHD_gtls_dh_params_int::params.
int MHD__gnutls_dh_params_init | ( | MHD_gtls_dh_params_t * | dh_params | ) |
MHD__gnutls_dh_params_init - This function will initialize the DH parameters : Is a structure that will hold the prime numbers
This function will initialize the DH parameters structure.
Definition at line 149 of file gnutls_dh_primes.c.
References GNUTLS_E_MEMORY_ERROR, MHD_gnutls_assert, and MHD_gnutls_calloc.
Definition at line 51 of file gnutls_dh_primes.c.
References GNUTLS_E_INTERNAL_ERROR, MHD_gnutls_assert, and MHD_gtls_mpi_release().
const mpi_t* MHD_gtls_dh_params_to_mpi | ( | MHD_gtls_dh_params_t | dh_primes | ) |
Definition at line 39 of file gnutls_dh_primes.c.
References MHD_gtls_dh_params_int::params.
Referenced by check_server_params(), gen_dhe_server_kx(), and proc_dhe_client_kx().