Lines Matching refs:key
36 int bt_mesh_encrypt(const struct bt_mesh_key *key, const uint8_t plaintext[16], in bt_mesh_encrypt() argument
39 return bt_encrypt_be(key->key, plaintext, enc_data); in bt_mesh_encrypt()
42 int bt_mesh_ccm_encrypt(const struct bt_mesh_key *key, uint8_t nonce[13], const uint8_t *plaintext, in bt_mesh_ccm_encrypt() argument
46 return bt_ccm_encrypt(key->key, nonce, plaintext, len, aad, aad_len, enc_data, mic_size); in bt_mesh_ccm_encrypt()
49 int bt_mesh_ccm_decrypt(const struct bt_mesh_key *key, uint8_t nonce[13], const uint8_t *enc_data, in bt_mesh_ccm_decrypt() argument
53 return bt_ccm_decrypt(key->key, nonce, enc_data, len, aad, aad_len, plaintext, mic_size); in bt_mesh_ccm_decrypt()
56 int bt_mesh_aes_cmac_raw_key(const uint8_t key[16], struct bt_mesh_sg *sg, size_t sg_len, in bt_mesh_aes_cmac_raw_key()
62 if (tc_cmac_setup(&state, key, &sched) == TC_CRYPTO_FAIL) { in bt_mesh_aes_cmac_raw_key()
79 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
82 return bt_mesh_aes_cmac_raw_key(key->key, sg, sg_len, mac); in bt_mesh_aes_cmac_mesh_key()
85 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()
90 if (tc_hmac_set_key(&h, key, 32) == TC_CRYPTO_FAIL) { in bt_mesh_sha256_hmac_raw_key()