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 #ifndef RUNTIME_CONTEXT_H
12 #define RUNTIME_CONTEXT_H
13 
14 #include <stdint.h>
15 
16 #include "common/byte_array.h"
17 #include "edhoc/buffer_sizes.h"
18 #include "edhoc/suites.h"
19 
20 struct runtime_context {
21 	uint8_t msg_buf[MSG_MAX_SIZE];
22 	struct byte_array msg;
23 #if EAD_SIZE != 0
24 	uint8_t ead_buf[EAD_SIZE];
25 #endif
26 	struct byte_array ead;
27 	struct suite suite;
28 	uint8_t msg1_hash_buf[HASH_SIZE];
29 	struct byte_array msg1_hash;
30 
31 	/*initiator specific*/
32 	uint8_t th4_buf[HASH_SIZE];
33 	struct byte_array th4;
34 	uint8_t prk_4e3m_buf[PRK_SIZE];
35 	struct byte_array prk_4e3m;
36 
37 	/*responder specific*/
38 	bool static_dh_i;
39 	uint8_t th3_buf[HASH_SIZE];
40 	struct byte_array th3;
41 	uint8_t prk_3e2m_buf[PRK_SIZE];
42 	struct byte_array prk_3e2m;
43 };
44 
45 #endif
46