Lines Matching full:key
21 * application keys (2 real keys per 1 configured) and device key + device key candidate.
35 "BLE Mesh PSA key id range overlaps maximum allowed boundary.");
38 "MAC length should be 16 bytes for 128-bits key for CMAC-AES");
41 "MAC length should be 32 bytes for 256-bits key for HMAC-SHA");
60 int bt_mesh_encrypt(const struct bt_mesh_key *key, const uint8_t plaintext[16], in bt_mesh_encrypt() argument
67 status = psa_cipher_encrypt(key->key, PSA_ALG_ECB_NO_PADDING, in bt_mesh_encrypt()
79 int bt_mesh_ccm_encrypt(const struct bt_mesh_key *key, uint8_t nonce[13], in bt_mesh_ccm_encrypt() argument
88 status = psa_aead_encrypt(key->key, alg, in bt_mesh_ccm_encrypt()
102 int bt_mesh_ccm_decrypt(const struct bt_mesh_key *key, uint8_t nonce[13], in bt_mesh_ccm_decrypt() argument
111 status = psa_aead_decrypt(key->key, alg, in bt_mesh_ccm_decrypt()
125 int bt_mesh_aes_cmac_mesh_key(const struct bt_mesh_key *key, struct bt_mesh_sg *sg, in bt_mesh_aes_cmac_mesh_key() argument
132 status = psa_mac_sign_setup(&operation, key->key, alg); in bt_mesh_aes_cmac_mesh_key()
159 int bt_mesh_aes_cmac_raw_key(const uint8_t key[16], struct bt_mesh_sg *sg, in bt_mesh_aes_cmac_raw_key()
165 err = bt_mesh_key_import(BT_MESH_KEY_TYPE_CMAC, key, &key_id); in bt_mesh_aes_cmac_raw_key()
172 psa_destroy_key(key_id.key); in bt_mesh_aes_cmac_raw_key()
177 int bt_mesh_sha256_hmac_raw_key(const uint8_t key[32], struct bt_mesh_sg *sg, size_t sg_len, in bt_mesh_sha256_hmac_raw_key()
189 /* Import a key */ in bt_mesh_sha256_hmac_raw_key()
196 status = psa_import_key(&attributes, key, 32, &key_id); in bt_mesh_sha256_hmac_raw_key()
232 /* Destroy the key */ in bt_mesh_sha256_hmac_raw_key()
257 /* Generate a key pair */ in bt_mesh_pub_key_gen()
294 "Exported PSA public key should be 1 byte larger than BLE Mesh public key");
307 /* Import a custom private key */ in bt_mesh_dhkey_gen()
325 /* For elliptic curve key pairs for Weierstrass curve families (PSA_ECC_FAMILY_SECP_R1) in bt_mesh_dhkey_gen()
326 * the representations of public key is: in bt_mesh_dhkey_gen()
453 status = psa_import_key(&key_attributes, in, 16, &out->key); in bt_mesh_key_import()
470 if (psa_export_key(in->key, out, 16, &data_length) != PSA_SUCCESS) { in bt_mesh_key_export()
485 bt_mesh_user_keyid_assign(dst->key); in bt_mesh_key_assign()
489 int bt_mesh_key_destroy(const struct bt_mesh_key *key) in bt_mesh_key_destroy() argument
491 if (psa_destroy_key(key->key) != PSA_SUCCESS) { in bt_mesh_key_destroy()
496 return bt_mesh_user_keyid_free(key->key); in bt_mesh_key_destroy()
502 int bt_mesh_key_compare(const uint8_t raw_key[16], const struct bt_mesh_key *key) in bt_mesh_key_compare() argument
507 err = bt_mesh_key_export(out, key); in bt_mesh_key_compare()