tls_ffdhe.h
Go to the documentation of this file.
1 /**
2  * @file tls_ffdhe.h
3  * @brief FFDHE key exchange
4  *
5  * @section License
6  *
7  * Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.
8  *
9  * This file is part of CycloneSSL Open.
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software Foundation,
23  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24  *
25  * @author Oryx Embedded SARL (www.oryx-embedded.com)
26  * @version 1.9.0
27  **/
28 
29 #ifndef _TLS_FFDHE_H
30 #define _TLS_FFDHE_H
31 
32 //Dependencies
33 #include "tls.h"
34 
35 //C++ guard
36 #ifdef __cplusplus
37  extern "C" {
38 #endif
39 
40 
41 /**
42  * @brief FFDHE parameters
43  **/
44 
45 typedef struct
46 {
47  const char_t *name; ///<Group name
48  const uint8_t p[512]; ///<Prime modulus
49  size_t pLen; ///<Length of the prime modulus, in bytes
50  uint8_t g; ///<Generator
52 
53 
54 //TLS related functions
56  const TlsSupportedGroupList *groupList);
57 
59  uint16_t namedGroup);
60 
62  const TlsFfdheGroup *ffdheGroup);
63 
64 //C++ guard
65 #ifdef __cplusplus
66  }
67 #endif
68 
69 #endif
TLS (Transport Layer Security)
char char_t
Definition: compiler_port.h:41
uint8_t p
Definition: ndp.h:295
const TlsFfdheGroup * tlsGetFfdheGroup(TlsContext *context, uint16_t namedGroup)
Get the FFDHE parameters that match the specified named group.
Definition: tls_ffdhe.c:313
error_t tlsSelectFfdheGroup(TlsContext *context, const TlsSupportedGroupList *groupList)
Select the named group to be used when performing FFDHE key exchange.
Definition: tls_ffdhe.c:173
FFDHE parameters.
Definition: tls_ffdhe.h:45
__start_packed struct @75 TlsSupportedGroupList
List of supported groups.
error_t
Error codes.
Definition: error.h:40
uint8_t g
Generator.
Definition: tls_ffdhe.h:50
error_t tlsLoadFfdheParameters(DhParameters *params, const TlsFfdheGroup *ffdheGroup)
Load FFDHE parameters.
Definition: tls_ffdhe.c:373
size_t pLen
Length of the prime modulus, in bytes.
Definition: tls_ffdhe.h:49
const char_t * name
Group name.
Definition: tls_ffdhe.h:47
#define TlsContext
Definition: tls.h:34
Diffie-Hellman parameters.
Definition: dh.h:46