Home
last modified time | relevance | path

Searched refs:key_id (Results 1 – 10 of 10) sorted by relevance

/Zephyr-Core-3.5.0/tests/bsim/bluetooth/mesh/src/
Ddistribute_keyid.c49 int bt_mesh_user_keyid_free(psa_key_id_t key_id) in bt_mesh_user_keyid_free() argument
51 if (IN_RANGE(key_id, BT_MESH_TEST_PSA_KEY_ID_USER_MIN, in bt_mesh_user_keyid_free()
53 atomic_clear_bit(pst_keys, key_id - BT_MESH_TEST_PSA_KEY_ID_USER_MIN); in bt_mesh_user_keyid_free()
55 LOG_INF("key id %d is freed", key_id); in bt_mesh_user_keyid_free()
63 void bt_mesh_user_keyid_assign(psa_key_id_t key_id) in bt_mesh_user_keyid_assign() argument
65 if (IN_RANGE(key_id, BT_MESH_TEST_PSA_KEY_ID_USER_MIN, in bt_mesh_user_keyid_assign()
67 atomic_set_bit(pst_keys, key_id - BT_MESH_TEST_PSA_KEY_ID_USER_MIN); in bt_mesh_user_keyid_assign()
68 LOG_INF("key id %d is assigned", key_id); in bt_mesh_user_keyid_assign()
70 LOG_WRN("key id %d is out of the reserved id range", key_id); in bt_mesh_user_keyid_assign()
/Zephyr-Core-3.5.0/drivers/crypto/
Dcrypto_ataes132a.c38 ataes132a_state[i].key_id = i; in ataes132a_init_states()
186 uint8_t key_id, in ataes132a_aes_ccm_decrypt() argument
214 if (!(ataes132a_state[key_id].key_config & ATAES_KEYCONFIG_EXTERNAL)) { in ataes132a_aes_ccm_decrypt()
215 LOG_ERR("key %x external mode disabled", key_id); in ataes132a_aes_ccm_decrypt()
234 if (!(ataes132a_state[key_id].key_config & ATAES_KEYCONFIG_AUTHKEY)) { in ataes132a_aes_ccm_decrypt()
236 " previous authentication", key_id); in ataes132a_aes_ccm_decrypt()
249 if (ataes132a_state[key_id].key_config & ATAES_KEYCONFIG_RAND_NONCE) { in ataes132a_aes_ccm_decrypt()
251 " nonce_buf will be ignored", key_id); in ataes132a_aes_ccm_decrypt()
263 if (!(ataes132a_state[key_id].key_config & ATAES_KEYCONFIG_RAND_NONCE) in ataes132a_aes_ccm_decrypt()
294 if (!(ataes132a_state[key_id].key_config & ATAES_KEYCONFIG_RAND_NONCE) in ataes132a_aes_ccm_decrypt()
[all …]
Dcrypto_ataes132a_priv.h204 uint8_t key_id; member
311 uint8_t key_id,
359 uint8_t key_id,
387 uint8_t key_id,
/Zephyr-Core-3.5.0/samples/tfm_integration/psa_crypto/src/
Dpsa_crypto.c49 static psa_status_t crp_get_pub_key(psa_key_id_t key_id, in crp_get_pub_key() argument
56 LOG_INF("Retrieving public key for key #%d", key_id); in crp_get_pub_key()
61 psa_open_key(key_id, &key_handle), in crp_get_pub_key()
64 LOG_ERR("Failed to open persistent key #%d", key_id); in crp_get_pub_key()
110 static psa_status_t crp_imp_key_secp256r1(psa_key_id_t key_id, in crp_imp_key_secp256r1() argument
125 LOG_INF("Persisting SECP256R1 key as #%d", (uint32_t)key_id); in crp_imp_key_secp256r1()
129 psa_set_key_id(&key_attributes, key_id); in crp_imp_key_secp256r1()
154 status = crp_get_pub_key(key_id, data_out, sizeof(data_out), &data_len); in crp_imp_key_secp256r1()
160 psa_open_key(key_id, &key_handle), in crp_imp_key_secp256r1()
163 LOG_ERR("Failed to open persistent key #%d", key_id); in crp_imp_key_secp256r1()
[all …]
/Zephyr-Core-3.5.0/subsys/bluetooth/mesh/
Dcrypto_psa.c161 struct bt_mesh_key key_id; in bt_mesh_aes_cmac_raw_key() local
164 err = bt_mesh_key_import(BT_MESH_KEY_TYPE_CMAC, key, &key_id); in bt_mesh_aes_cmac_raw_key()
169 err = bt_mesh_aes_cmac_mesh_key(&key_id, sg, sg_len, mac); in bt_mesh_aes_cmac_raw_key()
171 psa_destroy_key(key_id.key); in bt_mesh_aes_cmac_raw_key()
183 psa_key_id_t key_id; in bt_mesh_sha256_hmac_raw_key() local
195 status = psa_import_key(&attributes, key, 32, &key_id); in bt_mesh_sha256_hmac_raw_key()
203 status = psa_mac_sign_setup(&operation, key_id, alg); in bt_mesh_sha256_hmac_raw_key()
232 psa_destroy_key(key_id); in bt_mesh_sha256_hmac_raw_key()
366 __weak int bt_mesh_user_keyid_free(psa_key_id_t key_id) in bt_mesh_user_keyid_free() argument
368 if (IN_RANGE(key_id, BT_MESH_PSA_KEY_ID_USER_MIN, in bt_mesh_user_keyid_free()
[all …]
/Zephyr-Core-3.5.0/modules/openthread/platform/
Dcrypto_psa.c450 psa_key_id_t key_id = 0; in otPlatCryptoEcdsaGenerateKey() local
459 status = psa_generate_key(&attributes, &key_id); in otPlatCryptoEcdsaGenerateKey()
464 status = psa_export_key(key_id, aKeyPair->mDerBytes, OT_CRYPTO_ECDSA_MAX_DER_SIZE, in otPlatCryptoEcdsaGenerateKey()
473 psa_destroy_key(key_id); in otPlatCryptoEcdsaGenerateKey()
482 psa_key_id_t key_id = 0; in otPlatCryptoEcdsaGetPublicKey() local
491 status = psa_import_key(&attributes, aKeyPair->mDerBytes, aKeyPair->mDerLength, &key_id); in otPlatCryptoEcdsaGetPublicKey()
496 status = psa_export_public_key(key_id, buffer, sizeof(buffer), &exported_length); in otPlatCryptoEcdsaGetPublicKey()
505 psa_destroy_key(key_id); in otPlatCryptoEcdsaGetPublicKey()
515 psa_key_id_t key_id; in otPlatCryptoEcdsaSign() local
524 status = psa_import_key(&attributes, aKeyPair->mDerBytes, aKeyPair->mDerLength, &key_id); in otPlatCryptoEcdsaSign()
[all …]
/Zephyr-Core-3.5.0/tests/bluetooth/bt_crypto/src/
Dtest_bt_crypto.c138 uint8_t key_id[4] = {0x72, 0x62, 0x65, 0x6c}; in ZTEST() local
144 bt_crypto_h6(w, key_id, res); in ZTEST()
169 uint8_t key_id[4] = {0x48, 0x01, 0x03, 0xcc}; in ZTEST() local
175 bt_crypto_h8(k, s, key_id, res); in ZTEST()
/Zephyr-Core-3.5.0/subsys/bluetooth/crypto/
Dbt_crypto.c214 int bt_crypto_h6(const uint8_t w[16], const uint8_t key_id[4], uint8_t res[16]) in bt_crypto_h6()
221 LOG_DBG("key_id %s", bt_hex(key_id, 4)); in bt_crypto_h6()
224 sys_memcpy_swap(key_id_s, key_id, 4); in bt_crypto_h6()
262 int bt_crypto_h8(const uint8_t k[16], const uint8_t s[16], const uint8_t key_id[4], uint8_t res[16]) in bt_crypto_h8()
272 LOG_DBG("key_id %s", bt_hex(key_id, 4)); in bt_crypto_h8()
282 sys_memcpy_swap(key_id_s, key_id, 4); in bt_crypto_h8()
Dbt_crypto.h113 int bt_crypto_h6(const uint8_t w[16], const uint8_t key_id[4], uint8_t res[16]);
147 int bt_crypto_h8(const uint8_t k[16], const uint8_t s[16], const uint8_t key_id[4],
/Zephyr-Core-3.5.0/subsys/bluetooth/host/
Dsmp.c5199 uint8_t key_id[4] = { 0x72, 0x62, 0x65, 0x6c }; in smp_h6_test() local
5205 err = bt_crypto_h6(w, key_id, res); in smp_h6_test()
5247 uint8_t key_id[4] = {0xcc, 0x03, 0x01, 0x48}; in smp_h8_test() local
5254 err = bt_crypto_h8(k, s, key_id, res); in smp_h8_test()