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 HKDF_INFO_H 13 #define HKDF_INFO_H 14 15 #include "security_context.h" 16 #include "supported_algorithm.h" 17 18 #include "common/byte_array.h" 19 #include "common/oscore_edhoc_error.h" 20 21 /** 22 * @brief Encodes the HKDF Info as defined by OSCORE into the out-array 23 * @param id "Sender ID or Recipient ID when deriving keys and the empty 24 * byte string when deriving the Common IV" 25 * @param id_context ID Context 26 * @param aead_alg AEAD Algorithm 27 * @param type type of operation this HKDF Info is going to be used for 28 * @param out out-array. Must have a length of exactly the value returned 29 * in the out-parameter by `hkdf_info_len`. 30 * @return err 31 */ 32 enum err oscore_create_hkdf_info(struct byte_array *id, 33 struct byte_array *id_context, 34 enum AEAD_algorithm aead_alg, 35 enum derive_type type, struct byte_array *out); 36 37 #endif 38