Lines Matching refs:tfm_cmac
95 struct crypto_shash *tfm_cmac; member
134 struct crypto_shash *tfm_cmac; member
218 static int smp_f4(struct crypto_shash *tfm_cmac, const u8 u[32], in smp_f4() argument
232 err = aes_cmac(tfm_cmac, x, m, sizeof(m), res); in smp_f4()
241 static int smp_f5(struct crypto_shash *tfm_cmac, const u8 w[32], in smp_f5() argument
262 err = aes_cmac(tfm_cmac, salt, w, 32, t); in smp_f5()
277 err = aes_cmac(tfm_cmac, t, m, sizeof(m), mackey); in smp_f5()
285 err = aes_cmac(tfm_cmac, t, m, sizeof(m), ltk); in smp_f5()
294 static int smp_f6(struct crypto_shash *tfm_cmac, const u8 w[16], in smp_f6() argument
313 err = aes_cmac(tfm_cmac, w, m, sizeof(m), res); in smp_f6()
322 static int smp_g2(struct crypto_shash *tfm_cmac, const u8 u[32], const u8 v[32], in smp_g2() argument
336 err = aes_cmac(tfm_cmac, x, m, sizeof(m), tmp); in smp_g2()
348 static int smp_h6(struct crypto_shash *tfm_cmac, const u8 w[16], in smp_h6() argument
355 err = aes_cmac(tfm_cmac, w, key_id, 4, res); in smp_h6()
364 static int smp_h7(struct crypto_shash *tfm_cmac, const u8 w[16], in smp_h7() argument
371 err = aes_cmac(tfm_cmac, salt, w, 16, res); in smp_h7()
596 err = smp_f4(smp->tfm_cmac, smp->local_pk, smp->local_pk, in smp_generate_oob()
776 crypto_free_shash(smp->tfm_cmac); in smp_chan_destroy()
1170 if (smp_h7(smp->tfm_cmac, smp->tk, salt, smp->link_key)) { in sc_generate_link_key()
1179 if (smp_h6(smp->tfm_cmac, smp->tk, tmp1, smp->link_key)) { in sc_generate_link_key()
1186 if (smp_h6(smp->tfm_cmac, smp->link_key, lebr, smp->link_key)) { in sc_generate_link_key()
1228 if (smp_h7(smp->tfm_cmac, key->val, salt, smp->tk)) in sc_generate_ltk()
1234 if (smp_h6(smp->tfm_cmac, key->val, tmp2, smp->tk)) in sc_generate_ltk()
1238 if (smp_h6(smp->tfm_cmac, smp->tk, brle, smp->tk)) in sc_generate_ltk()
1402 smp->tfm_cmac = crypto_alloc_shash("cmac(aes)", 0, 0); in smp_chan_create()
1403 if (IS_ERR(smp->tfm_cmac)) { in smp_chan_create()
1426 crypto_free_shash(smp->tfm_cmac); in smp_chan_create()
1452 return smp_f5(smp->tfm_cmac, smp->dhkey, na, nb, a, b, mackey, ltk); in sc_mackey_and_ltk()
1485 smp_f6(smp->tfm_cmac, smp->mackey, smp->prnd, smp->rrnd, r, io_cap, in sc_dhkey_check()
1503 if (smp_f4(smp->tfm_cmac, smp->local_pk, smp->remote_pk, smp->prnd, r, in sc_passkey_send_confirm()
1528 if (smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk, in sc_passkey_round()
2187 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk, in smp_cmd_pairing_random()
2214 err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey); in smp_cmd_pairing_random()
2699 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->remote_pk, in smp_cmd_public_key()
2800 err = smp_f4(smp->tfm_cmac, smp->local_pk, smp->remote_pk, smp->prnd, in smp_cmd_public_key()
2848 err = smp_f6(smp->tfm_cmac, smp->mackey, smp->rrnd, smp->prnd, r, in smp_cmd_dhkey_check()
3227 struct crypto_shash *tfm_cmac; in smp_add_cid() local
3246 tfm_cmac = crypto_alloc_shash("cmac(aes)", 0, 0); in smp_add_cid()
3247 if (IS_ERR(tfm_cmac)) { in smp_add_cid()
3251 return ERR_CAST(tfm_cmac); in smp_add_cid()
3257 crypto_free_shash(tfm_cmac); in smp_add_cid()
3265 smp->tfm_cmac = tfm_cmac; in smp_add_cid()
3275 crypto_free_shash(smp->tfm_cmac); in smp_add_cid()
3323 crypto_free_shash(smp->tfm_cmac); in smp_del_chan()
3653 static int __init test_f4(struct crypto_shash *tfm_cmac) in test_f4() argument
3675 err = smp_f4(tfm_cmac, u, v, x, z, res); in test_f4()
3685 static int __init test_f5(struct crypto_shash *tfm_cmac) in test_f5() argument
3709 err = smp_f5(tfm_cmac, w, n1, n2, a1, a2, mackey, ltk); in test_f5()
3722 static int __init test_f6(struct crypto_shash *tfm_cmac) in test_f6() argument
3745 err = smp_f6(tfm_cmac, w, n1, n2, r, io_cap, a1, a2, res); in test_f6()
3755 static int __init test_g2(struct crypto_shash *tfm_cmac) in test_g2() argument
3777 err = smp_g2(tfm_cmac, u, v, x, y, &val); in test_g2()
3787 static int __init test_h6(struct crypto_shash *tfm_cmac) in test_h6() argument
3799 err = smp_h6(tfm_cmac, w, key_id, res); in test_h6()
3825 struct crypto_shash *tfm_cmac, in run_selftests() argument
3858 err = test_f4(tfm_cmac); in run_selftests()
3864 err = test_f5(tfm_cmac); in run_selftests()
3870 err = test_f6(tfm_cmac); in run_selftests()
3876 err = test_g2(tfm_cmac); in run_selftests()
3882 err = test_h6(tfm_cmac); in run_selftests()
3910 struct crypto_shash *tfm_cmac; in bt_selftest_smp() local
3920 tfm_cmac = crypto_alloc_shash("cmac(aes)", 0, CRYPTO_ALG_ASYNC); in bt_selftest_smp()
3921 if (IS_ERR(tfm_cmac)) { in bt_selftest_smp()
3924 return PTR_ERR(tfm_cmac); in bt_selftest_smp()
3930 crypto_free_shash(tfm_cmac); in bt_selftest_smp()
3935 err = run_selftests(tfm_aes, tfm_cmac, tfm_ecdh); in bt_selftest_smp()
3937 crypto_free_shash(tfm_cmac); in bt_selftest_smp()