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 OKM_H 12 #define OKM_H 13 14 #include <stdint.h> 15 16 #include "hkdf_info.h" 17 #include "suites.h" 18 19 #include "common/oscore_edhoc_error.h" 20 21 /** 22 * @brief Derives output keying material. 23 * 24 * @param hash_alg HASH algorithm 25 * @param prk pseudorandom key 26 * @param prk_len length of prk 27 * @param th transcripthash 28 * @param th_len length of th 29 * @param label human readable label 30 * @param context relevant only for MAC_2 and MAC_3 31 * @param context_len lenhgt of context 32 * @param okm ouput pointer 33 * @param okm_len length of okm 34 */ 35 enum err okm_calc(enum hash_alg hash_alg, const uint8_t *prk, uint32_t prk_len, 36 const uint8_t *th, uint32_t th_len, const char *label, 37 uint8_t *context, uint32_t context_len, uint8_t *okm, 38 uint32_t okm_len); 39 40 #endif 41