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 AAD_H 13 #define AAD_H 14 15 #include "option.h" 16 #include "supported_algorithm.h" 17 18 #include "common/byte_array.h" 19 #include "common/oscore_edhoc_error.h" 20 21 /** 22 * @brief Serialize given parameters into the AAD structure. 23 * @param options CoAP Options to include in AAD (only Class 24 * I Options will be included) 25 * @param opt_num Number of options 26 * @param aead_alg AEAD Algorithm to use 27 * @param request_kid in the request 28 * @param request_piv in the request 29 * @param out out-array. Must have the exact length as 30 * provided by `aad_length`. 31 * @return err 32 */ 33 enum err create_aad(struct o_coap_option *options, uint16_t opt_num, 34 enum AEAD_algorithm aead_alg, 35 struct byte_array *request_kid, 36 struct byte_array *request_piv, struct byte_array *out); 37 38 #endif 39