1 /*
2    Copyright (c) 2021 Fraunhofer AISEC. See the COPYRIGHT
3    file at the top-level directory of this distribution.
4 
5    Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6    http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7    <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8    option. This file may not be copied, modified, or distributed
9    except according to those terms.
10 */
11 
12 #ifndef EDHOC_METHOD_TYPE_H
13 #define EDHOC_METHOD_TYPE_H
14 
15 #include <stdbool.h>
16 
17 #include "common/oscore_edhoc_error.h"
18 
19 /*
20 +-------+-------------------+-------------------+-------------------+
21 | Value | Initiator         | Responder         | Reference         |
22 +-------+-------------------+-------------------+-------------------+
23 |     0 | Signature Key     | Signature Key     | [1]               |
24 |     1 | Signature Key     | Static DH Key     | [1]               |
25 |     2 | Static DH Key     | Signature Key     | [1]               |
26 |     3 | Static DH Key     | Static DH Key     | [1]               |
27 +-------+-------------------+-------------------+-------------------+
28 [1]: https://datatracker.ietf.org/doc/draft-ietf-lake-edhoc/
29 */
30 
31 enum method_type {
32 	INITIATOR_SK_RESPONDER_SK = 0,
33 	INITIATOR_SK_RESPONDER_SDHK = 1,
34 	INITIATOR_SDHK_RESPONDER_SK = 2,
35 	INITIATOR_SDHK_RESPONDER_SDHK = 3,
36 };
37 
38 /**
39  * @brief                       Retrieves the authentication type of initiator
40  *                              and responder.
41  *
42  * @param m                     The method.
43  * @param[out] static_dh_i      True if the initiator authenticates with static
44  *                              DH key.
45  * @param[out] static_dh_r      True if the responder authenticates with static
46  *                              DH key.
47  * @retval                      None.
48  */
49 void authentication_type_get(enum method_type m, volatile bool *static_dh_i,
50 				 volatile bool *static_dh_r);
51 
52 #endif
53