1# This file is dual licensed under the terms of the Apache License, Version
2# 2.0, and the BSD License. See the LICENSE file in the root of this repository
3# for complete details.
4
5from __future__ import absolute_import, division, print_function
6
7INCLUDES = """
8#include <openssl/ecdh.h>
9"""
10
11TYPES = """
12static const int Cryptography_HAS_ECDH;
13static const int Cryptography_HAS_SET_ECDH_AUTO;
14"""
15
16FUNCTIONS = """
17int ECDH_compute_key(void *, size_t, const EC_POINT *, EC_KEY *,
18                     void *(*)(const void *, size_t, void *, size_t *));
19long SSL_CTX_set_ecdh_auto(SSL_CTX *, int);
20"""
21
22CUSTOMIZATIONS = """
23static const long Cryptography_HAS_ECDH = 1;
24
25#ifndef SSL_CTX_set_ecdh_auto
26static const long Cryptography_HAS_SET_ECDH_AUTO = 0;
27long (*SSL_CTX_set_ecdh_auto)(SSL_CTX *, int) = NULL;
28#else
29static const long Cryptography_HAS_SET_ECDH_AUTO = 1;
30#endif
31"""
32