wolfSSL 3.11.1 for TLS1.3 beta
Fork of wolfSSL by
wolfssl/openssl/dh.h@3:6f956bdb3073, 2016-04-28 (annotated)
- Committer:
- wolfSSL
- Date:
- Thu Apr 28 00:56:55 2016 +0000
- Revision:
- 3:6f956bdb3073
wolfSSL 3.9.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wolfSSL | 3:6f956bdb3073 | 1 | /* dh.h for openSSL */ |
wolfSSL | 3:6f956bdb3073 | 2 | |
wolfSSL | 3:6f956bdb3073 | 3 | |
wolfSSL | 3:6f956bdb3073 | 4 | #ifndef WOLFSSL_DH_H_ |
wolfSSL | 3:6f956bdb3073 | 5 | #define WOLFSSL_DH_H_ |
wolfSSL | 3:6f956bdb3073 | 6 | |
wolfSSL | 3:6f956bdb3073 | 7 | #include <wolfssl/openssl/ssl.h> |
wolfSSL | 3:6f956bdb3073 | 8 | #include <wolfssl/openssl/bn.h> |
wolfSSL | 3:6f956bdb3073 | 9 | |
wolfSSL | 3:6f956bdb3073 | 10 | #ifdef __cplusplus |
wolfSSL | 3:6f956bdb3073 | 11 | extern "C" { |
wolfSSL | 3:6f956bdb3073 | 12 | #endif |
wolfSSL | 3:6f956bdb3073 | 13 | |
wolfSSL | 3:6f956bdb3073 | 14 | struct WOLFSSL_DH { |
wolfSSL | 3:6f956bdb3073 | 15 | WOLFSSL_BIGNUM* p; |
wolfSSL | 3:6f956bdb3073 | 16 | WOLFSSL_BIGNUM* g; |
wolfSSL | 3:6f956bdb3073 | 17 | WOLFSSL_BIGNUM* pub_key; /* openssh deference g^x */ |
wolfSSL | 3:6f956bdb3073 | 18 | WOLFSSL_BIGNUM* priv_key; /* openssh deference x */ |
wolfSSL | 3:6f956bdb3073 | 19 | void* internal; /* our DH */ |
wolfSSL | 3:6f956bdb3073 | 20 | char inSet; /* internal set from external ? */ |
wolfSSL | 3:6f956bdb3073 | 21 | char exSet; /* external set from internal ? */ |
wolfSSL | 3:6f956bdb3073 | 22 | /*added for lighttpd openssl compatibility, go back and add a getter in |
wolfSSL | 3:6f956bdb3073 | 23 | * lighttpd src code. |
wolfSSL | 3:6f956bdb3073 | 24 | */ |
wolfSSL | 3:6f956bdb3073 | 25 | int length; |
wolfSSL | 3:6f956bdb3073 | 26 | }; |
wolfSSL | 3:6f956bdb3073 | 27 | |
wolfSSL | 3:6f956bdb3073 | 28 | |
wolfSSL | 3:6f956bdb3073 | 29 | WOLFSSL_API WOLFSSL_DH* wolfSSL_DH_new(void); |
wolfSSL | 3:6f956bdb3073 | 30 | WOLFSSL_API void wolfSSL_DH_free(WOLFSSL_DH*); |
wolfSSL | 3:6f956bdb3073 | 31 | |
wolfSSL | 3:6f956bdb3073 | 32 | WOLFSSL_API int wolfSSL_DH_size(WOLFSSL_DH*); |
wolfSSL | 3:6f956bdb3073 | 33 | WOLFSSL_API int wolfSSL_DH_generate_key(WOLFSSL_DH*); |
wolfSSL | 3:6f956bdb3073 | 34 | WOLFSSL_API int wolfSSL_DH_compute_key(unsigned char* key, WOLFSSL_BIGNUM* pub, |
wolfSSL | 3:6f956bdb3073 | 35 | WOLFSSL_DH*); |
wolfSSL | 3:6f956bdb3073 | 36 | |
wolfSSL | 3:6f956bdb3073 | 37 | typedef WOLFSSL_DH DH; |
wolfSSL | 3:6f956bdb3073 | 38 | |
wolfSSL | 3:6f956bdb3073 | 39 | #define DH_new wolfSSL_DH_new |
wolfSSL | 3:6f956bdb3073 | 40 | #define DH_free wolfSSL_DH_free |
wolfSSL | 3:6f956bdb3073 | 41 | |
wolfSSL | 3:6f956bdb3073 | 42 | #define DH_size wolfSSL_DH_size |
wolfSSL | 3:6f956bdb3073 | 43 | #define DH_generate_key wolfSSL_DH_generate_key |
wolfSSL | 3:6f956bdb3073 | 44 | #define DH_compute_key wolfSSL_DH_compute_key |
wolfSSL | 3:6f956bdb3073 | 45 | |
wolfSSL | 3:6f956bdb3073 | 46 | |
wolfSSL | 3:6f956bdb3073 | 47 | #ifdef __cplusplus |
wolfSSL | 3:6f956bdb3073 | 48 | } /* extern "C" */ |
wolfSSL | 3:6f956bdb3073 | 49 | #endif |
wolfSSL | 3:6f956bdb3073 | 50 | |
wolfSSL | 3:6f956bdb3073 | 51 | #ifdef HAVE_STUNNEL |
wolfSSL | 3:6f956bdb3073 | 52 | #define DH_generate_parameters wolfSSL_DH_generate_parameters |
wolfSSL | 3:6f956bdb3073 | 53 | #define DH_generate_parameters_ex wolfSSL_DH_generate_parameters_ex |
wolfSSL | 3:6f956bdb3073 | 54 | #endif /* HAVE_STUNNEL */ |
wolfSSL | 3:6f956bdb3073 | 55 | #endif /* header */ |
wolfSSL | 3:6f956bdb3073 | 56 |