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 "suites.h" 16 17 #include "common/byte_array.h" 18 #include "common/oscore_edhoc_error.h" 19 20 enum info_label { 21 KEYSTREAM_2 = 0, 22 SALT_3e2m = 1, 23 MAC_2 = 2, 24 K_3 = 3, 25 IV_3 = 4, 26 SALT_4e3m = 5, 27 MAC_3 = 6, 28 PRK_out = 7, 29 K_4 = 8, 30 IV_4 = 9, 31 PRK_exporter = 10, 32 PRK_out_update = 11, 33 }; 34 35 /** 36 * @brief Encodes the HKDF Info. 37 * 38 * @param label An int value indicating what kind of output we 39 * are generating. 40 * @param[in] context All possible contexts are listed in figure 7 41 * in the spec. 42 * @param okm_len The length of the output keying material. 43 * @param[out] out The result. 44 * @return Ok or error code. 45 */ 46 enum err create_hkdf_info(uint8_t label, struct byte_array *context, 47 uint32_t okm_len, struct byte_array *out); 48 49 #endif 50