Line data Source code
1 1 : /** @file 2 : * @brief Keys APIs. 3 : */ 4 : 5 : /* 6 : * Copyright (c) 2023 Nordic Semiconductor ASA 7 : * 8 : * SPDX-License-Identifier: Apache-2.0 9 : */ 10 : 11 : #ifndef ZEPHYR_INCLUDE_BLUETOOTH_MESH_KEYS_H_ 12 : #define ZEPHYR_INCLUDE_BLUETOOTH_MESH_KEYS_H_ 13 : 14 : #include <stdint.h> 15 : #if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA || defined CONFIG_BT_MESH_USES_TFM_PSA 16 : #include <psa/crypto.h> 17 : #endif 18 : 19 : #ifdef __cplusplus 20 : extern "C" { 21 : #endif 22 : 23 : #if defined CONFIG_BT_MESH_USES_MBEDTLS_PSA || defined CONFIG_BT_MESH_USES_TFM_PSA 24 : 25 : /** The structure that keeps representation of key. */ 26 : struct bt_mesh_key { 27 : /** PSA key representation is the PSA key identifier. */ 28 : psa_key_id_t key; 29 : }; 30 : 31 : #elif defined CONFIG_BT_MESH_USES_TINYCRYPT 32 : 33 : /** The structure that keeps representation of key. */ 34 : struct bt_mesh_key { 35 : /** tinycrypt key representation is the pure key value. */ 36 : uint8_t key[16]; 37 : }; 38 : 39 : #else 40 : #error "Crypto library has not been chosen" 41 : #endif 42 : 43 : #ifdef __cplusplus 44 : } 45 : #endif 46 : 47 : #endif /* ZEPHYR_INCLUDE_BLUETOOTH_MESH_KEYS_H_ */