Renesas / SecureDweet
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers dh.h Source File

dh.h

00001 /* dh.h for openSSL */
00002 
00003 
00004 #ifndef WOLFSSL_DH_H_
00005 #define WOLFSSL_DH_H_
00006 
00007 #include <wolfssl/openssl/ssl.h>
00008 #include <wolfssl/openssl/bn.h>
00009 
00010 #ifdef __cplusplus
00011     extern "C" {
00012 #endif
00013 
00014 struct WOLFSSL_DH {
00015     WOLFSSL_BIGNUM* p;
00016     WOLFSSL_BIGNUM* g;
00017     WOLFSSL_BIGNUM* pub_key;      /* openssh deference g^x */
00018     WOLFSSL_BIGNUM* priv_key;     /* openssh deference x   */
00019     void*          internal;     /* our DH */
00020     char           inSet;        /* internal set from external ? */
00021     char           exSet;        /* external set from internal ? */
00022     /*added for lighttpd openssl compatibility, go back and add a getter in 
00023      * lighttpd src code.
00024      */
00025      int length;
00026 };
00027 
00028 
00029 WOLFSSL_API WOLFSSL_DH* wolfSSL_DH_new(void);
00030 WOLFSSL_API void       wolfSSL_DH_free(WOLFSSL_DH*);
00031 
00032 WOLFSSL_API int wolfSSL_DH_size(WOLFSSL_DH*);
00033 WOLFSSL_API int wolfSSL_DH_generate_key(WOLFSSL_DH*);
00034 WOLFSSL_API int wolfSSL_DH_compute_key(unsigned char* key, WOLFSSL_BIGNUM* pub,
00035                                      WOLFSSL_DH*);
00036 
00037 typedef WOLFSSL_DH DH;
00038 
00039 #define DH_new  wolfSSL_DH_new 
00040 #define DH_free wolfSSL_DH_free
00041 
00042 #define DH_size         wolfSSL_DH_size
00043 #define DH_generate_key wolfSSL_DH_generate_key
00044 #define DH_compute_key  wolfSSL_DH_compute_key
00045 
00046 
00047 #ifdef __cplusplus
00048     }  /* extern "C" */ 
00049 #endif
00050 
00051 #ifdef HAVE_STUNNEL
00052 #define DH_generate_parameters    wolfSSL_DH_generate_parameters
00053 #define DH_generate_parameters_ex wolfSSL_DH_generate_parameters_ex
00054 #endif /* HAVE_STUNNEL */
00055 #endif /* header */
00056